webpack-plugin-cdn-free
Traversal encapsulation of the webpack output file
Install
$ npm i webpack-plugin-cdn-free --save-dev
Conifg
const webpack = ; //to access built-in pluginsvar CdnWebpack = moduleexports = module: rules: test: /\.txt$/ use: 'raw-loader' plugins: { // custom cdn ... return true // Returning false interrupts } publicPath: "http://example.com" // cdn domain names prefixPath: "prefixPath" // The url common prefix that needs to be passed to the CDN ... ;
ignore
If need to use the CDN file exclusion. You need to create a new file ".cdnignore"
./.cdnignore
indexhtmldist/statis/*
Exclude the rules:here
Introduction
- This plug-in supports only one CDN domain
- There may be problems with prefix configuration and domain name configuration failure, please be sure to use problems. issue
- The existing policy of this plug-in will interrupt the whole process in case of failure for any reason to ensure the quality of release.
- If you encounter packaged output that is not completely generated from the configured extension, you need to check yourself to see if it is really missing.
Questions & Suggestions
Please open an issue here.