-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvue.config.js
More file actions
57 lines (56 loc) · 1.5 KB
/
Copy pathvue.config.js
File metadata and controls
57 lines (56 loc) · 1.5 KB
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
const appConfig = require('./src/app.config')
module.exports = {
chainWebpack: config => {
config.module
.rule('i18n')
.resourceQuery(/blockType=i18n/)
.use('i18n')
.loader('@kazupon/vue-i18n-loader')
.end()
},
configureWebpack: {
devtool: 'source-map',
// We provide the app's title in Webpack's name field, so that
// it can be accessed in index.html to inject the correct title.
name: appConfig.title,
// Set up all the aliases we use in our app.
resolve: {
alias: require('./aliases.config').webpack
}
},
css: {
// Enable CSS source maps.
sourceMap: true
},
pwa: {
debug: true,
workboxPluginMode: 'GenerateSW',
workboxOptions: {
templatedUrls: {
'/': 'index.ssr.html'
},
runtimeCaching: [
{
urlPattern: new RegExp('/.*.(png|jpg|jpeg|svg|gif|woff|eot|ttf)/'),
handler: 'networkFirst',
options: {
cacheName: 'allCache',
expiration: {
maxEntries: 1000,
maxAgeSeconds: 60 * 10
}
}
}
]
}
},
// Configure Webpack's dev server.
// https://github.com/vuejs/vue-cli/blob/dev/docs/cli-service.md
devServer: {
...(process.env.API_BASE_URL
? // Proxy API endpoints to the production base URL.
{ proxy: { '/api': { target: process.env.API_BASE_URL } } }
: // Proxy API endpoints a local mock API.
{ before: require('./tests/mock-api') })
}
}