Is there a correct way to use minified XLSX on an Angular 5 project?
Currently I'm using it as:
import * as XLSX from 'xlsx';
Using this import like:
const worksheet: XLSX.WorkSheet = XLSX.utils.json_to_sheet(json);
And
const workbook: XLSX.WorkBook = XLSX.utils.book_new();
It works just fine, but produces a very large bundle object inside my build:

I want to know if it's possible to use the .min files, to help reduce the bundle size. And if so, how to import and use it properly?
The minified version itself is about that size. There is a smaller xlsx.core.min.js file ~460KB (~145KB gzipped) that omits the cpexcel blob.
To omit the cpexcel blob in the build without having to reference the separate file, you can suppress cpexcel.js in the webpack config, as shown in the webpack demo. If you are using the angular cli, you may need to eject.
Hi,
How can we configure this for angular cli build?
How can we configure this for react?
Most helpful comment
The minified version itself is about that size. There is a smaller
xlsx.core.min.jsfile ~460KB (~145KB gzipped) that omits the cpexcel blob.To omit the cpexcel blob in the build without having to reference the separate file, you can suppress
cpexcel.jsin the webpack config, as shown in the webpack demo. If you are using the angular cli, you may need to eject.