forked from vuejs/vue-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
36 lines (35 loc) · 854 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
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(require.resolve('graphql-tag/loader'))
.end()
},
devServer: {
headers: {
'Access-Control-Allow-Origin': '*'
},
port
}
}
}