Skip to content

Please provide a min.js file the NPM package #40

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
cbruun opened this issue Dec 6, 2016 · 7 comments
Closed

Please provide a min.js file the NPM package #40

cbruun opened this issue Dec 6, 2016 · 7 comments

Comments

@cbruun
Copy link

cbruun commented Dec 6, 2016

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

@ktsn
Copy link
Member

ktsn commented Dec 7, 2016

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?

@cbruun
Copy link
Author

cbruun commented Dec 7, 2016

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 :)

@yyx990803
Copy link
Member

yyx990803 commented Dec 7, 2016

@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.

@cbruun
Copy link
Author

cbruun commented Dec 13, 2016

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.

@ktsn
Copy link
Member

ktsn commented Dec 17, 2016

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

@ktsn
Copy link
Member

ktsn commented Dec 17, 2016

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

@cbruun
Copy link
Author

cbruun commented Dec 17, 2016

@ktsn Thank you :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants