-
Notifications
You must be signed in to change notification settings - Fork 1
/
vue.config.js
62 lines (60 loc) · 1.59 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
const path = require('path');
const PrerenderSPAPlugin = require('prerender-spa-plugin');
const Renderer = PrerenderSPAPlugin.PuppeteerRenderer;
module.exports = {
pages: {
index: {
entry: 'src/main.js',
title: 'PetShop',
},
},
devServer: {
port: 3001,
open: true,
},
css: {
loaderOptions: {
sass: {
prependData: `
@import "~@/assets/scss/helpers/variables.scss";
@import "~@/assets/scss/helpers/mixins.scss";
@import "~@/assets/scss/helpers/functions.scss";
`,
},
},
},
configureWebpack: (config) => {
if (process.env.NODE_ENV === 'production') {
config.plugins.push(
new PrerenderSPAPlugin({
staticDir: path.join(__dirname, 'dist'),
routes: ['/', '/about', '/news', '/coupon', '/adopt', '/contact', '/signin'],
minify: {
collapseBooleanAttributes: true,
collapseWhitespace: true,
decodeEntities: true,
keepClosingSlash: true,
sortAttributes: true,
minifyCSS: true,
},
renderer: new Renderer({
renderAfterDocumentEvent: 'render-event',
headless: true,
}),
}),
);
}
// eslint-disable-next-line no-param-reassign
config.resolve.alias['@img'] = '@/assets/img';
},
pwa: {
name: 'PetShop',
themeColor: '#4bb36e',
msTileColor: '#000000',
appleMobileWebAppCapable: 'yes',
appleMobileWebAppStatusBarStyle: 'black-translucent',
workboxOptions: {
exclude: [/\.map$/, /_redirects/],
},
},
};