Gathering detailed insights and metrics for dynamic-cdn-webpack-plugin
Gathering detailed insights and metrics for dynamic-cdn-webpack-plugin
Gathering detailed insights and metrics for dynamic-cdn-webpack-plugin
Gathering detailed insights and metrics for dynamic-cdn-webpack-plugin
@talend/dynamic-cdn-webpack-plugin
Dynamically get your dependencies from a cdn rather than bundling them in your app
add-asset-html-cdn-webpack-plugin
base on 'html-webpack-plugin' dynamic injection of cdn data to html template
webpack-dynamic-cdn-plugin
Plugin for rewrite, at runtime, webpack assets url for loading application from CDN dynamicaly
webpack-dynamic-import-cdn-plugin
> support webpack5 ## usage
Get your dependencies from a cdn rather than bundling them in your app
npm install dynamic-cdn-webpack-plugin
Typescript
Module System
Min. Node Version
Node Version
NPM Version
JavaScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
346 Stars
87 Commits
37 Forks
3 Watchers
3 Branches
5 Contributors
Updated on Feb 10, 2025
Latest Version
5.0.0
Package Id
dynamic-cdn-webpack-plugin@5.0.0
Unpacked Size
17.45 kB
Size
5.72 kB
File Count
7
NPM Version
6.13.3
Node Version
12.10.0
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
Dynamically get your dependencies from a cdn rather than bundling them in your app
$ npm install --save-dev dynamic-cdn-webpack-plugin module-to-cdn
If you are using webpack --version <= 3
then you should be installing with the following command.
$ npm install --save-dev dynamic-cdn-webpack-plugin@3.4.1 module-to-cdn
webpack.config.js
1const path = require('path'); 2 3const HtmlWebpackPlugin = require('html-webpack-plugin'); 4const DynamicCdnWebpackPlugin = require('dynamic-cdn-webpack-plugin'); 5 6module.exports = { 7 entry: { 8 'app.js': './src/app.js' 9 }, 10 11 output: { 12 path.resolve(__dirname, './build'), 13 }, 14 15 plugins: [ 16 new HtmlWebpackPlugin(), 17 new DynamicCdnWebpackPlugin() 18 ] 19}
app.js
1import React from 'react'; 2import { BrowserRouter } from 'react-router-dom'; 3 4// ... do react stuff
webpack --mode=production
will generate:
1/* simplified webpack build */ 2[function(module, __webpack_exports__, __webpack_require__) { 3 module.exports = React; 4}), 5(function(module, __webpack_exports__, __webpack_require__) { 6 module.exports = ReactRouterDOM; 7}), 8(function(module, __webpack_exports__, __webpack_require__) { 9 var react = __webpack_require__(0); 10 var reactRouterDOM = __webpack_require__(1); 11 12 /* ... */ 13})]
1<!DOCTYPE html> 2<html> 3 <head> 4 <meta charset="UTF-8"> 5 <title>Webpack App</title> 6 </head> 7 <body> 8 <script type="text/javascript" src="https://unpkg.com/react@15.5.3/dist/react.min.js"></script><script type="text/javascript" src="https://unpkg.com/react-router-dom@4.1.1/umd/react-router-dom.min.js"></script><script src="build/app.js"></script></body> 9</html>
webpack.config.js
1const path = require('path'); 2 3const ManifestPlugin = require('webpack-manifest-plugin'); 4const DynamicCdnWebpackPlugin = require('dynamic-cdn-webpack-plugin'); 5 6module.exports = { 7 entry: { 8 'app': './src/app.js' 9 }, 10 11 output: { 12 path.resolve(__dirname, './build'), 13 }, 14 15 plugins: [ 16 new ManifestPlugin({ 17 fileName: 'manifest.json' 18 }), 19 new DynamicCdnWebpackPlugin() 20 ] 21}
app.js
1import React from 'react'; 2import { BrowserRouter } from 'react-router-dom'; 3 4// ... do react stuff
webpack --mode=production
will generate:
1/* simplified webpack build */ 2[function(module, __webpack_exports__, __webpack_require__) { 3 module.exports = React; 4}), 5(function(module, __webpack_exports__, __webpack_require__) { 6 module.exports = ReactRouterDOM; 7}), 8(function(module, __webpack_exports__, __webpack_require__) { 9 var react = __webpack_require__(0); 10 var reactRouterDOM = __webpack_require__(1); 11 12 /* ... */ 13})]
1{ 2 "app.js": "app.js", 3 "react.js": "https://unpkg.com/react@15.5.3/dist/react.min.js", 4 "react-router-dom.js": "https://unpkg.com/react-router-dom@4.1.1/umd/react-router-dom.min.js" 5}
webpack.config.js
1const DynamicCdnWebpackPlugin = require('dynamic-cdn-webpack-plugin'); 2 3module.exports = { 4 mode: 'production', 5 plugins: [ 6 new DynamicCdnWebpackPlugin(options) 7 ] 8}
Type: boolean
Default: false
Useful when working offline, will fallback to webpack normal behaviour
Type: string
Default: mode
Values: development
, production
Determine if it should load the development or the production version of modules
Type: Array<string>
Default: null
List the only modules that should be served by the cdn
Type: Array<string>
Default: []
List the modules that will always be bundled (not be served by the cdn)
Type: boolean
Default: false
Log whether the library is being served by the cdn or is bundled
Type: string
, function
Default: 'module-to-cdn'
Allow you to define a custom module resolver, it can either be a function
or an npm module.
The resolver should return (or resolve as a Promise) either null
or an object
with the keys: name
, var
, url
, version
.
Thanks goes to these wonderful people (emoji key):
Thomas Sileghem 💻 📖 ⚠️ | Faizaan 💬 💻 📖 | MICHAEL JACKSON 💡 | fedeoo 💻 |
---|
This project follows the all-contributors specification. Contributions of any kind welcome!
MIT © Thomas Sileghem
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 4/26 approved changesets -- score normalized to 1
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
12 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More