KO
|
EN
gitlite — search
Search
#javascript
#python
#hacktoberfest
#react
#ai
#typescript
#llm
#go
#golang
#android
#machine-learning
#rust
#deep-learning
#linux
cdn-webpack-plugin
★ 8
Open GitHub ↗
No description available.
Download README (.md)
Explore Similar Repositories
docker-mecab
:
MeCab docker image based on alpine
pokegovenn.github.io
:
a venn diagram tracker for pokemon go
JustNotes
:
javaweb,android,node.js各种不错的项目汇总
maven-deployer-extension
:
maven-deployer-extension
live
:
基于phpcms为基础的客户端(iOS、android)接口demo
// repository documentation
Was this content helpful?
★ 0
(0 ratings)
Select Rating:
★
★
★
★
★
Submit Feedback
Recent Feedback
×
Download README
Do you want to download the
README.md
file for
cdn-webpack-plugin
?
Download (.md)
CDN Webpack Plugin =================== Installation ------------ Install the plugin with npm: ```shell $ npm install cdn-webpack-plugin --save-dev ``` Basic Usage ----------- as we know,in the webpack config,`publicPath` is only a string,but in my daily project. we will meet one situation,we should put the static resources into different domain of CDN this is what we want to fix config as follows: ```javascript var cdnWebpackPlugin = require('cdn-webpack-plugin'); var webpackConfig = { entry: { 'main':['main.js'] 'home':['home.js'] 'index':['index.js'] }, output: { path: 'dist', filename: '[name].js', publicPath:'/static' }, plugins: [new cdnWebpackPlugin(['http://cdn1.cdn.com','http://cdn2.cdn.com'])] }; ``` This will generate a file `dist/index.html` containing the following: ```html <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>Webpack App</title> </head> <body> <script src="http://cdn1.cdn.com/static/main.js"></script> <script src="http://cdn2.cdn.com/static/home.js"></script> <script src="http://cdn1.cdn.com/static/index.js"></script> </body> </html> ```