I am using xlsx-style npm module in my angular2 application for creating excels dynamically. Reason for using xlsx-style rather than xlsx module is because I need to style the cells which is not possible using xlsx.
I have copied the xlsx.full.min.js from dist folder(from node_modules/xlsx-style) to assets folder and attached as a scritp tag to html page.
Ref : how to use SheetJS (js-xlsx) in angular 2
I have imported the module into my component for namespace based access into my code.
declare var XLSX : any;
While building the app using ng build, I get the following error : Cannot find namespace 'XLSX'
Using @angular/cli @latest (Webpack)