This repository has been archived by the owner on Dec 9, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 15
/
vue.config.js
140 lines (120 loc) · 3.77 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
process.env.VUE_APP_TITLE = 'Fretboarder';
process.env.VUE_APP_BASE_URL = 'https://fretboarder.app';
process.env.VUE_APP_VERSION = require('./package.json').version;
process.env.VUE_APP_DESCRIPTION = require('./package.json').description;
module.exports = {
productionSourceMap: false,
devServer: {
https: true,
host: 'localhost',
port: '8080',
},
css: {
// Enable source maps in dev mode only
sourceMap: process.env.NODE_ENV === 'development',
// Import the mixins in every component
loaderOptions: {
scss: {
additionalData: `
@use "@cheap-glitch/scss-mixins/_mixins" as *;
@use "@/styles/layout";
@use "sass-mq/_mq" as * with (
$mq-breakpoints: (
desktop: layout.$mq-breakpoint-desktop,
wide: layout.$mq-breakpoint-wide,
)
);
`
}
}
},
chainWebpack: config => {
// Minify the CSS in `public/index.html`
config.plugin('html').tap(args => {
args[0].minify = {
collapseWhitespace: true,
removeComments: true,
removeRedundantAttributes: true,
removeScriptTypeAttributes: true,
removeStyleLinkTypeAttributes: true,
useShortDoctype: true,
minifyCSS: true,
};
return args;
});
// Enable tests coverage
if (process.env.NODE_ENV === 'test') {
config.module.rule('js')
.test(/\.js$/)
.use('istanbul-instrumenter-loader')
.loader('istanbul-instrumenter-loader')
.options({ esModules: true });
}
},
pluginOptions: {
// Stylelint
lintStyleOnBuild: true,
// Font Awesome icons
fontawesome: {
component: 'fa-icon',
imports: !isModuleAvailable('@fortawesome/pro-regular-svg-icons') ? {} : {
// General UI
'arrow-left': 'pro-regular',
'chevron-down': 'pro-regular',
'chevron-up': 'pro-regular',
'ellipsis-h': 'pro-regular',
// Instruments
'banjo': 'pro-regular',
'guitar': 'pro-regular',
'guitar-electric': 'pro-regular',
'mandolin': 'pro-regular',
// Tools & settings
'arrow-circle-up': 'pro-regular',
'arrows-v': 'pro-regular',
'cog': 'pro-regular',
'desktop': 'pro-regular',
'desktop-alt': 'pro-regular',
'file-download': 'pro-regular',
'file-image': 'pro-regular',
'hand-paper': 'pro-regular',
'image-polaroid': 'pro-regular',
'info-circle': 'pro-regular',
'list-music': 'pro-regular',
'list-ol': 'pro-regular',
'moon': 'pro-regular',
'music': 'pro-regular',
'sun': 'pro-regular',
// Scales
'plus': 'pro-regular',
'trash-alt': 'pro-regular',
'eye': 'pro-regular',
'eye-slash': 'pro-regular',
'bullseye': 'pro-regular',
'intersection': 'pro-solid',
'copy': 'pro-regular',
'times-circle': 'pro-regular',
// Footer
'twitter': 'free-brands',
'github': 'free-brands',
'paper-plane': 'pro-regular',
'heart': 'pro-regular',
'external-link-square-alt': 'pro-regular',
}
},
// Sitemap
sitemap: {
trailingSlash: false,
productionOnly: true,
baseURL: process.env.VUE_APP_BASE_URL,
urls: [{
loc: '/',
priority: 1.0,
changefreq: 'always',
}]
},
}
}
function isModuleAvailable(name) {
try { require.resolve(name) } catch(_err) { return false; }
return true;
}