-
Notifications
You must be signed in to change notification settings - Fork 26
Description
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:
ERROR in ./node_modules/Globalize/dist/globalize.js
Module not found: Error: Can't resolve 'cldr/event' in 'C:\Projects\webpack2-testing\node_modules\Globalize\dist'
@ ./node_modules/Globalize/dist/globalize.js 22:2-25:14
@ ./node_modules/Globalize/dist/node-main.js
@ ./app/index.ts
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:
declare module 'globalize' {
export = Globalize;
}
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:
Uncaught TypeError: Cannot read property 'call' of undefined
at __webpack_require__ (vendor.js:55)
Whereas the vendor.js:55 line is:
// Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
Is there something wrong in my configuration or what could be the cause of the issue...?
Thanks,
Dominic