webpack.05-Output出力プロファイル
1225 ワード
https://www.webpackjs.com/con...
cnpm init-y
cnpm i-D webpack webpack-cli
プロファイルwebpack.co.nfig.js
cnpm init-y
cnpm i-D webpack webpack-cli
プロファイルwebpack.co.nfig.js
const path=require('path')
module.exports={
entry:{
test:'./src/index.js',
demo:'./src/main.js'
},
mode:'development',
output:{
//hash 6
filename:'[name]_[hash:6]_bundle.js',
path:path.join(__dirname,'lib'),
// :test_6ae182_bundle.js demo_6ae182_bundle.js,
/*
cdn , , publicPath
*/
//publicPath:'http://cdn.baidu.com/assets'
}
}
設定ファイルのpackge.json{
"name": "05",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"build": "webpack --config webpack.config.js"
},
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
"webpack": "^4.43.0",
"webpack-cli": "^3.3.11"
}
}
未完…