mirror of
https://github.com/vuejs/vue-cli.git
synced 2026-01-15 11:50:19 -06:00
BREAKING CHANGE: `devBaseUrl` option has been removed. `baseUrl` now works for both development and production. To use different paths for prod/dev, use conditional values based on `process.env.NODE_ENV` in `vue.config.js`.
30 lines
678 B
JavaScript
30 lines
678 B
JavaScript
exports.clientAddonConfig = function ({ id, port = 8042 }) {
|
|
return {
|
|
baseUrl: process.env.NODE_ENV === 'production'
|
|
? `/_addon/${id}`
|
|
: `http://localhost:${port}/`,
|
|
configureWebpack: {
|
|
output: {
|
|
// Important
|
|
filename: 'index.js'
|
|
}
|
|
},
|
|
css: {
|
|
extract: false
|
|
},
|
|
chainWebpack: config => {
|
|
config.plugins.delete('preload')
|
|
config.plugins.delete('prefetch')
|
|
config.plugins.delete('html')
|
|
config.plugins.delete('optimize-css')
|
|
config.optimization.splitChunks(false)
|
|
},
|
|
devServer: {
|
|
headers: {
|
|
'Access-Control-Allow-Origin': '*'
|
|
},
|
|
port
|
|
}
|
|
}
|
|
}
|