Webpack plugin to automatically extract dependencies and reference them via CDN.
This plugin will scan your dependencies and devDependencies, extract those suitable to be hosted on CDN via lib/hints.js and add them to externals, a <script> tag will be added to your html-webpack-plugin generated HTML file so that these dependencies can be referenced via CDN.
Usage
This plugin requires html-webpack-plugin@4.x to work.
webpack-auto-cdn-plugin
Webpack plugin to automatically extract dependencies and reference them via CDN.
This plugin will scan your
dependenciesanddevDependencies, extract those suitable to be hosted on CDN via lib/hints.js and add them toexternals, a<script>tag will be added to yourhtml-webpack-plugingenerated HTML file so that these dependencies can be referenced via CDN.Usage
This plugin requires
html-webpack-plugin@4.xto work.Options
{string} cwd: Current working directory wherepackage.jsonof your project is.Play It
Have a look at
dist/index.htmlanddist/main.js, all dependencies are removed from dist javascript,<script>tags are generated automatically.