move-to-public-path-webpack-plugin
v0.9.2
Published
将打包后生成的文件移动到 webpack 所配置的 outputPath 路径
Downloads
2
Readme
move-to-public-path-webpack-plugin
用于将 webpack 构建之后产生的文件移动到 publicPath 所设置的路径。
install
npm install move-to-public-path-webpack-plugin --save-dev
yarn add move-to-public-path-webpack-plugin -D
webpack
// webpack.config.js
const MoveToPublicPathWebpackPlugin = require('move-to-public-path-webpack-plugin').default
module.exports = {
publicPath:'/your/public/path/',
plugins:[
new MoveToPublicPathWebpackPlugin()
]
}
chainWebpack
import MoveToPublicPathWebpackPlugin from 'move-to-public-path-webpack-plugin'
const chainWebpack = (config)=>{
config.output.publicPath('/your/public/path/')
config.plugins('move-to-public-path-webpack-plugin').use(MoveToPublicPathWebpackPlugin)
}