-
Notifications
You must be signed in to change notification settings - Fork 0
/
gridsome.config.js
71 lines (63 loc) · 1.75 KB
/
gridsome.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
63
64
65
66
67
68
69
70
71
/* eslint-disable no-process-env */ // 'cuz configuration file and requires environment variables
/* eslint-disable @typescript-eslint/camelcase */ // 'cuz key name of configuration is specified
const Fiber = require('fibers');
const HardSourceWebpackPlugin = require('hard-source-webpack-plugin');
const TerserPlugin = require('terser-webpack-plugin');
const VuetifyLoaderPlugin = require('vuetify-loader/lib/plugin');
const { appHost, displayName, description, name } = require('./package.json');
const production = process.env.NODE_ENV === 'production';
module.exports = {
port: 3000,
siteName: displayName,
siteDescription: description,
siteUrl: `${appHost}/${name}`,
pathPrefix: `/${name}`,
icon: 'src/assets/app-icon.png',
css: {
loaderOptions: {
sass: {
prependData: '@import "~/assets/style/variables.scss"',
sassOptions: {
fiber: Fiber
}
}
}
},
plugins: [
{ use: '@gridsome/plugin-google-analytics', options: { id: 'UA-109297390-1' }},
{ use: '@gridsome/plugin-sitemap' },
{ use: 'gridsome-plugin-typescript' },
{
use: '@gridsome/source-filesystem',
options: {
typeName: 'Game',
path: 'src/data/games/*.json'
}
}
],
templates: {
Game: '/stages/:fileInfo__name'
},
configureWebpack: {
module: {
rules: [
{ test: /\.(?:js|ts|vue)$/u, loader: 'eslint-loader' }
]
},
plugins: [
new VuetifyLoaderPlugin(),
...production ? [] : [ new HardSourceWebpackPlugin() ]
],
optimization: {
minimizer: [
new TerserPlugin({
terserOptions: {
compress: {
drop_console: production
}
}
})
]
}
}
};