-
Notifications
You must be signed in to change notification settings - Fork 45
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
Use rollup for builds #47
Conversation
Removed `hot` command from `package.json`, as rollup does not support HMR. `rollup-plugin-terser` is locked @v2.0.2 because of TrySound/rollup-plugin-terser#5 NOTE: No unit test working at this time! I could not check if the config works well on actual applications!
Related to #45. NOTE: `object-path` is an UMD module, that can't be well tree-shaken by rollup. It would be best to use equivalent pure CommonJS/ES modules
The main field now uses the pre-built ES (for modules) version of the package.
The browser-ready bundle is now an IIFE, that does not export anything, and simply register itself in vue.
Replaced objectPath all import to simple `get` import in `src/classes/column` Deleted `webpack.config.js`
Hey @pstephan1187 ! Any news on this? |
Awesome! I'm loving that file size! 17Kb compared to the 26 previously is super nice! Also, the build time is so much faster. Really liking that. Nice job I do have a couple thoughts:
Forgive me if my questions seem elementary. I do not spend a lot of time in the UMD/CommonJs/ES6 world. I am a backend developer and have been playing catch-up the last year or so and am still ignorant with all the differences and idiosyncrasies. Also, the example scripts that have to be compiled are not working (custom theme and AJAX). When opening the examples in the browsers, I am getting a Thus far, I am really liking the benefits of rollup. Much smaller file sizes and much faster build times are great. Thank you for the work you have done. |
I've spotted a few fixes to do anyway. So don't accept the PR for now. I wait for your reply to eventually do changes for 1., 2., or 4. if required. |
I appreciate the good answers. I'll have to do more reading on the different Javascript formats.
|
|
`iife` build now named `vuejs-datatable.js` `esm` build now named `vuejs-datatable.esm.js`
`npm run build` is equivalent to `npm run production && npm run examples`
OK I think it's good to go. Sorry for that: I don't understand why the error you saw wasn't thrown on my environment... Maybe cache problems. :/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks good! All the examples are running perfectly now. Thank you for the work!
… only for node Related to the work 7 researches done for GerkinDev/vuejs-datatable#47
Hey! Here we come to the PR of #45!
I've configured examples for the new built files, & created a rollup config for examples (just run
npm run examples
. I've also a bit changed the instructions on theajax
page to get rid of any globally installed packages (portable scripts rulz). Everything seems fine.If you really care about gaining some bytes, it may be useful to change from
object-path
and use another non-UMD module. Also, this may trigger some trivial errors about rollup not being able to check ifset
orget
is exported by this module, and it requires a bit of extra conf for application build:https://github.com/pstephan1187/vue-datatable/blob/fe468af64a83575b60ef30f49f50c917684c82cb/examples/rollup.examples.config.js#L11-L19
Btw, about #24, you can now
import whatyouwant from 'vue';
, as it is excluded from builds. I know you already solved this problem, but hey, it's always good to have & know.Cheers!