Vue-class-component: Please provide a min.js file the NPM package

Created on 6 Dec 2016  路  7Comments  路  Source: vuejs/vue-class-component

I think it makes sense for this library to provide a min.js file, just like Vue does it.

Most helpful comment

I'm not sure providing minified version since vue-class-component only provide for the commonjs build.
Is it not suffice for you to use uglifyjs on your build process so that vue-class-component is minified with your codes?

All 7 comments

I'm not sure providing minified version since vue-class-component only provide for the commonjs build.
Is it not suffice for you to use uglifyjs on your build process so that vue-class-component is minified with your codes?

I personally prefer a minified version to keep my build process complexity low(er). A modern JS build setup tends to get big and complex, even for small apps.

One of the selling points of Vue is how easy it is to get started. Add the script and you can start coding.

A minified commonjs and browserified file would be helpful. It keeps in line with Vue itself and makes it easier to consume this library. Choice is always good :)

@cbruun hmm I think you might have some misunderstanding of how this works - as for now decorator is not even part of the spec (stage 2), the only way you can use it is with a build step via Babel or TypeScript. Also ES2015 classes are only supported in latest browsers if you don't use a build step. A minified version just don't make much sense in this situation.

I see your point.

In my case I am using TypeScript and bundling it with Rollup. I am not using the CommonJS version of Vue, as it adds about 2 seconds of extra crunch time for Rollup. VueJS has a small footprint, so I won't get much from tree shaking it. I'd rather have the fast compile time.

vue-class-component only works with the Vue CommonJS bundle, as the regular bundle does not have a default export of Vue (as in Vue['default'] is undefined).

I just wanted to be able to add the scripts tags for Vue and vue-class-component and write my TypeScript app without dealing with CommonJS.

It makes sense to me. I'll add umd and minified umd build from next version.

@cbruun On v4.4.0 or later, you can use minified build on dist/vue-class-component.min.js

@ktsn Thank you :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

micobarac picture micobarac  路  6Comments

valorad picture valorad  路  4Comments

spiffytech picture spiffytech  路  4Comments

vishr picture vishr  路  3Comments

championswimmer picture championswimmer  路  3Comments