Webpack plugin for Globalize.js that handles CLDR data loading, formatter precompilation, and locale chunk splitting. Current stable version is 3.0.0, compatible with Webpack 4 and Globalize ^1.3.0. Key differentiator: optimizes Globalize performance by precompiling formatters at build time for production, while allowing dynamic CLDR loading during development for faster HMR. Requires splitting code into vendor, globalize-compiled, and application chunks. Supports multiple locales and output customization.
npm install globalize-webpack-pluginVerified import paths — ran on the pinned version, not inferred.
Example webpack configuration using GlobalizePlugin with production/development mode, English and Spanish locales, and custom output filenames.
Upgrade to webpack 4 or use globalize-webpack-plugin v2.x for webpack 3, v1.x for webpack 2, v0.x for webpack 1.
Upgrade Node.js to >=4.3.0.
Migrate to webpack 2+ and use corresponding plugin version.
Configure entry points to separate vendor libraries (including 'globalize') from application code; plugin will generate globalize-compiled chunks.
Upgrade to v1.0.1 or later, which includes a fix for compatibility with ModuleScopePlugin.
Ensure CLDR data is loaded in development or use production mode for precompilation.
Install cldr-data as a dev dependency: npm install cldr-data --save-dev.
Ensure globalize is included in a vendor chunk and imported in your entry file.
Check that the plugin is properly required and instantiated: new GlobalizePlugin({ ... }).Verify that the locales listed in supportedLocales exist in your CLDR data and message files.