-
Notifications
You must be signed in to change notification settings - Fork 0
/
vue.config.js
38 lines (36 loc) · 1 KB
/
vue.config.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
37
38
module.exports = {
pages: {
popup: {
template: 'public/browser-extension.html',
entry: './src/popup/main.js',
title: 'Popup',
},
options: {
template: 'public/browser-extension.html',
entry: './src/options/main.js',
title: 'Options',
},
},
pluginOptions: {
browserExtension: {
componentOptions: {},
manifestSync: ['version', 'description'],
},
},
chainWebpack(config) {
// Only convert .svg files that are imported by these files as Vue component
const FILE_RE = /\.(vue|js|ts|svg)$/
// Use vue-cli's default rule for svg in non .vue .js .ts files
config.module.rule('svg').issuer(file => !FILE_RE.test(file))
// Use our loader to handle svg imported by other files
config.module
.rule('svg-component')
.test(/\.svg$/)
.issuer(file => FILE_RE.test(file))
.use('vue')
.loader('vue-loader')
.end()
.use('svg-to-vue-component')
.loader('svg-to-vue-component/loader')
},
}