A webpack plugin that generates a script to load all chunks and externals into HTML. Version 1.1.3 supports webpack 4. It creates load files per entry point, including CSS assets, and integrates with html-webpack-plugin. Unlike other external loaders, it automatically resolves external library versions from node_modules and supports custom CDN paths via string or function. The plugin is intended for production use only and has unchanged API since v1.0.
npm install webpack-external-pluginNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Creates a webpack config using WebpackExternalPlugin to generate a load script that includes externals (React, ReactDOM) from CDN and the main bundle. Outputs 'load-bundle.js' in dist folder.
Use a distinct filename pattern, e.g., 'load-[name].js'.
Stay on webpack 4 or migrate to an alternative plugin.
Ensure mode is 'production' or conditionally add plugin only in production builds.
Add externals to webpack config as object mapping package name to global variable.
Ensure function returns a string URL; do not omit parameters.
Set devtool false for production builds to avoid source maps being excluded.
Ensure webpack is version 4 and plugin is added in a correct environment (production).
Downgrade to webpack 4 or use a different plugin that supports webpack 5.
Change plugin filename to include a unique prefix like 'load-'.
Check node_modules for react version; ensure cdnPath is correct.