mirror of
https://github.com/vuejs/vue-cli.git
synced 2026-01-17 12:50:04 -06:00
* feat: deprecate confusing `baseUrl` option, use `publicPath` instead. * fix: do not touch CHANGELOG.md * docs: links referring baseUrl now changed to publicPath
37 lines
837 B
JavaScript
37 lines
837 B
JavaScript
exports.clientAddonConfig = function ({ id, port = 8042 }) {
|
|
return {
|
|
publicPath: 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)
|
|
|
|
config.module
|
|
.rule('gql')
|
|
.test(/\.(gql|graphql)$/)
|
|
.use('gql-loader')
|
|
.loader('graphql-tag/loader')
|
|
.end()
|
|
},
|
|
devServer: {
|
|
headers: {
|
|
'Access-Control-Allow-Origin': '*'
|
|
},
|
|
port
|
|
}
|
|
}
|
|
}
|