forked from karrot-dev/karrot-frontend
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathquasar.conf.js
137 lines (130 loc) · 4.14 KB
/
quasar.conf.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
/*
* This file runs in a Node context (it's NOT transpiled by Babel), so use only
* the ES6 features that are supported by your Node version. https://node.green/
*/
// Configuration for your app
// https://quasar.dev/quasar-cli-vite/quasar-config-js
/* eslint-env node */
const { resolve } = require('path')
const { configure } = require('quasar/wrappers')
const aliases = require('./aliases').resolve.alias
const { getHttpsOptions } = require('./build/https')
module.exports = configure(function (ctx) {
const { backend, proxyTable } = require('./build/config')
const appEnv = {
KARROT: {
BACKEND: backend,
THEME: process.env.KARROT_THEME,
GIT_SHA1: process.env.GIT_SHA1 || process.env.CIRCLE_SHA1,
},
NODE_DEBUG: 'false', // workaround for node-util
ENABLE_DEV_SENTRY: process.env.ENABLE_DEV_SENTRY,
}
return {
supportTS: false,
htmlVariables: {
title: 'Karrot - Start a group, become a community',
},
boot: [
'vueQuery',
'loglevel',
'pwa',
'helloDeveloper',
'addressbar-color',
'i18n',
'bootstrapData',
'polyfill',
'icons',
'detectMobileKeyboard',
'performance',
],
css: [
'app.sass',
],
extras: [
'fontawesome-v5',
'roboto-font-latin-ext', // this or either 'roboto-font', NEVER both!
'material-icons',
],
build: {
env: appEnv,
sourceMap: true,
alias: aliases,
target: {
// https://esbuild.github.io/api/#target
// Trying to make the most compatible version possible :)
browser: ['es2015', 'edge18', 'firefox60', 'chrome55', 'opera2017', 'ios12'],
},
vitePlugins: [
['@intlify/unplugin-vue-i18n/vite', {
compositionOnly: false,
include: [resolve(__dirname, './src/locales/locale-*.json')],
}],
['rollup-plugin-visualizer', {
emitFile: true,
gzipSize: true,
filename: 'bundlesize.html',
}],
],
},
devServer: {
https: ctx.dev && ctx.mode.pwa ? getHttpsOptions() : false,
port: ctx.mode.pwa ? 8082 : 8080, // different port is recommended to avoid caching issues between modes
open: !process.env.NO_OPEN_BROWSER, // opens browser window automatically
proxy: proxyTable,
},
framework: {
cssAddon: true,
iconSet: 'material-icons',
lang: 'en-US',
config: {},
plugins: [
'Dialog',
'AppVisibility',
'Notify',
'AddressbarColor',
],
},
animations: [],
pwa: {
extendManifestJson (manifest) {
if (process.env.PWA_APP_NAME) {
manifest.name = process.env.PWA_APP_NAME
manifest.short_name = process.env.PWA_APP_NAME
}
if (process.env.KARROT_THEME) {
manifest.icons = [
{
src: 'icons/dev.png',
sizes: '512x512',
type: 'image/png',
},
{
src: 'icons/dev.svg',
},
]
}
},
workboxMode: 'injectManifest',
extendInjectManifestOptions (injectManifestOptions) {
// I'm not totally sure which options are the best to use here, but should be OK for now :)
// https://developer.chrome.com/docs/workbox/reference/workbox-build/#method-injectManifest
Object.assign(injectManifestOptions, {
// Workbox is passed the directory of all the built files, then globs for which ones should be precached
// using these patterns... by default it's *everything* minus a few service worker things
// That means it would load ALL our built files up front...
// ... change it to not precache anything
globPatterns: [],
globIgnores: [
...injectManifestOptions.globIgnores,
// A partial solution to a more complex issue
// See https://github.com/karrot-dev/karrot-frontend/issues/2209
'index.html',
],
// Everything in here has already got hashed path names, so don't need to add more
dontCacheBustURLsMatching: /^assets\//,
})
},
},
}
})