Open dominic-simplan opened 6 years ago
Nevermind, issue was that I was excluding the node_modules folder when configuring the ts-loader in the webpack-config.js. Sorry for creating this ticket.
Sorry need to reopen this again... the issue was not excluding node_modules. Unintentionally I had changed the plugin mode back to development, which also worked before. Changing back to production lead to the same error as before (Cannot read property 'call' of undefined).
If I change the typeScript module to "amd", I am getting the following error instead:
Uncaught TypeError: currencyFormatter is not a function
at component (bundle.js:12)
at Object.<anonymous> (bundle.js:16)
at Object.4 (bundle.js:17)
at __webpack_require__ (vendor.js:55)
at webpackJsonpCallback (vendor.js:26)
at bundle.js:1
Hi, I am having issue getting the globalize-webpack-plugin to work in my Typescript project which is using CommonJS.
I have created a sample project here. When I build the project, I am getting the following error:
Seems like webpack tries to use AMD instead of CommonJS?
If I remove the globalize import from the index.ts, it builds without error, but I get an error in the browser:
Uncaught ReferenceError: Globalize is not defined
In another attempt, I added a globalize.d.ts with the following content:
and changed the import to
import * as Globalize from 'globalize';
. This works in development mode, but as soon as I change to production, I get the following error:Whereas the vendor.js:55 line is:
Is there something wrong in my configuration or what could be the cause of the issue...?
Thanks, Dominic