On വെള്ളി 01 ഡിസംബര്‍ 2017 12:05 രാവിലെ, Paolo Greppi wrote:
> According to this:
> https://medium.com/webpack/webpack-and-rollup-the-same-but-different-a41ad427058c
> we really should use rollup over webpack.

But we don't have rollup in main, we have been working on it for quite
some time and it is going to take quite some more time before we can use
it in main. webpack is almost there (packaging complete), except for the
conflict with ftp masters on node-babel-preset-env.

See node-d3-zoom or node-d3-scale for example webpack configuration.

> Upstream uses rollup+buble and the build/config.js confuses me.
> So I gave rollup+babel a try, starting from scratch, here is my journey.
> 
> I picked:
> - node-he, node-rollup-plugin-commonjs and node-babel-plugin-external-helpers 
> from main, 
> - node-rollup-plugin-node-resolve from the NEW queue
> 
> Installed from npm:
> - rollup-plugin-babel (could be worth an ITP)
> - babel-preset-es2015-rollup
> the latter will not be necessary anymore with Babel>6.13, see 
> https://github.com/rollup/rollup-plugin-babel#configuring-babel
> 
> .babelrc:
> { "presets": ["es2015-rollup", "flow-vue"] }
> 
> rollup.config.js:
> import resolve from 'rollup-plugin-node-resolve';
> import babel from 'rollup-plugin-babel';
> export default {
>   entry: './src/platforms/web/entry-runtime-with-compiler.js',
>   moduleName: 'Vue',
>   plugins: [resolve(), babel({exclude: 'node_modules/**'})],
>   dest: { 'dist/vue.js' }
> };
> 
> then:
> rollup -c rollup.config.js -f umd
> 
> I get 2 times "[!] Error: A module cannot import itself" which I git rid with:
> diff --git a/src/platforms/web/compiler/directives/model.js 
> b/src/platforms/web/compiler/directives/model.js
> -import { genComponentModel, genAssignmentCode } from 
> 'compiler/directives/model'
> +import { genComponentModel, genAssignmentCode } from 
> '/compiler/directives/model'
> diff --git a/src/platforms/web/compiler/index.js 
> b/src/platforms/web/compiler/index.js
> -import { createCompiler } from 'compiler/index'
> +import { createCompiler } from '/compiler/index'
> 
> I am unsure about these fixes, it completes with warnings:
> (!) Unresolved dependencies
> https://github.com/rollup/rollup/wiki/Troubleshooting#treating-module-as-external-dependency
> web/util/element (imported by src/core/vdom/patch.js)
> /compiler/directives/model (imported by 
> src/platforms/web/compiler/directives/model.js)
> he (imported by src/compiler/parser/index.js)
> web/compiler/util (imported by src/compiler/parser/html-parser.js)
> /compiler/index (imported by src/platforms/web/compiler/index.js)
> (!) Unused external imports
> default imported from external module 'he' but never used
> isNonPhrasingTag imported from external module 'web/compiler/util' but never 
> used
> (!) Missing global variable names
> Use options.globals to specify browser global variable names corresponding to 
> external modules
> web/util/element (guessing 'web_util_element')
> /compiler/directives/model (guessing 
> '_______________compiler_directives_model')
> he (guessing 'he')
> web/compiler/util (guessing 'web_compiler_util')
> /compiler/index (guessing '_______________compiler_index')
> created dist/vue.js in 10.8s
> 
> and:
> ls -l dist
> -rw-r--r-- 1 root root 239866 Nov 30 19:26 vue.js
> ...

I guess you could ignore the warnings.

> Paolo
> 


Attachment: signature.asc
Description: OpenPGP digital signature

-- 
Pkg-javascript-devel mailing list
Pkg-javascript-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-javascript-devel

Reply via email to