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
XLSX bundle size using Webpack #694
Comments
There's really not much we can do on the modularity front. There are three major hurdles:
If you know you aren't dealing with non-English users, you can suppress the codepage optional library in your webpack config: module.exports = {
/* ... */
resolve: {
alias: { "./dist/cpexcel.js": "" }
},
/* ... */
} |
The solution to optimize project (includes xlsx) builded with vue-cli,website:https://segmentfault.com/a/1190000014284449 |
For me it works with webpack code splitting. With const xlsx = await import('xlsx'); or import('xlsx').then(xlsx => {
// do something with xlsx
}); the main bundle size isn't affected and the |
0.15.0 ships with a mini build that is limited to XLSX operations (xlsx.mini.min.js). It is 180K uncompressed / 57K compressed. XLS support requires the huge codepage library, there isn't much room for reducing the bundle size. If there is another specific slice that you need (say, just the read functionality), we can look into preparing another mini build. |
Looks like |
We tested in a direct script tag injection (http://sheetjs.com/demos/tablemini) but not in a bundle setup :( it'll be corrected in the next release |
Any updates? Will proper tree-shaking be available? |
@yss14 - is there any way to do what you did in Angular? |
@itayperry Never used Angular, but I think so. Just google for |
thank @yss14 and @SheetJSDev i use vuejs. it works for me but vuejs should create a vue.config.js file, containing:
|
The XLSX bundle size after webpack build is huge. Before minification, the size is 1.03 MB. Is there any way to reduce the bundle size using any modular techniques? Examples of packages are antd and lodash which provides options to reduce the bundle size. It will be good to have a plugin for webpack (webpack-plugin-xlsx) which reduces the bundle size (by cherry-picking relevant modules). Thanks.
The text was updated successfully, but these errors were encountered: