If your project is using vue-cli
and you want to modify the output.publicPath
option of webpack, you can use this plugin, otherwise you don't need to use it.
Because vue-cli does not allow direct modification of output.publicPath. see docs
Install
npm install vuecli-publicpath-webpack-plugin -D
Usage
in vue.config.js
You can use this plugin through the configureWebpack
method
const WebpackPublicPathPlugin = require('vuecli-publicpath-webpack-plugin')
module.exports = {
...
configureWebpack:(config)=>{
config.plugins = [
...config.plugins,
new WebpackPublicPathPlugin('your cdn path')
]
}
}