kartsims / vue-customelement-bundler

How to bundle a Vue.js components in a single JS file, to be used in any HTML/JS app
http://vuetips.com/vue-web-components
126 stars 20 forks source link

Added rollup config version #2

Closed chimon2000 closed 7 years ago

chimon2000 commented 7 years ago

This version reduces the file size further to 74kb minified (24 gzipped).

chimon2000 commented 7 years ago

@kartsims all requested changes added!!!

kartsims commented 7 years ago

Yeah!

I tested it, removed a few more webpack dependencies, and got the following output :

~/dev/vue-customelement-bundler ■ npm run dev

> vue-customelement-bundler@1.0.0 dev /Users/simon/dev/vue-customelement-bundler
> rollup -c -w

⚠   'default' is imported from external module 'fs' but never used

bundling...
⚠   Use of eval is strongly discouraged, as it poses security risks and may cause issues with minification
https://github.com/rollup/rollup/wiki/Troubleshooting#avoiding-eval
node_modules/vue-custom-element/dist/vue-custom-element.esm.js (23:4)
21:   if (typeof Symbol === 'undefined' || typeof Reflect === 'undefined') { return false; }
22:   try {
23:     eval('class Foo {}');
        ^
24:   } catch (e) {
25:     return false;

⚠   No format option was supplied – defaulting to 'es'
https://github.com/rollup/rollup/wiki/JavaScript-API#format

bundled in 3871ms. Watching for changes...

Any idea where these warnings come from ? I am merging the PR anyway (to a rollup branch) but that would be less scary without those warnings ;)

kartsims commented 7 years ago

What I did :

The final gzipped file is 25% lighter, that is something ! Thanks again :)