-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathquasar.config.js
More file actions
283 lines (247 loc) · 10.3 KB
/
quasar.config.js
File metadata and controls
283 lines (247 loc) · 10.3 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
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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
/* eslint-env node */
/*
* 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/quasar-conf-js
import ESLintPlugin from 'eslint-webpack-plugin'
import express from 'express'
import MomentLocalesPlugin from 'moment-locales-webpack-plugin'
import { configure } from 'quasar/wrappers'
import webpack from 'webpack'
const devServerConfig = require('./quasar.config.dev')
module.exports = configure(function (/* ctx */) {
return {
// app boot file (/src/boot)
// --> boot files are part of "main.js"
// https://quasar.dev/quasar-cli/cli-documentation/boot-files
// the order matters, so be careful when adding new boot files
boot: [
'errorHandling', // "errorHandling" should be the first boot file to begin catching errors earlier
'store',
'appConfig',
'i18n',
'api',
'auth',
'router',
'user',
'route-helper',
'acl',
'vuelidate',
'sanatizer',
'vue-wait',
'vue-word-highlighter',
'vue-json-pretty',
'portal-vue',
'filters',
'creation-session',
'proxy-autorefresh-context',
'e2e-testing',
'help-button'
],
// https://quasar.dev/quasar-cli/quasar-conf-js#Property%3A-css
css: [
'app.sass'
],
// https://github.com/quasarframework/quasar/tree/dev/extras
extras: [
// 'ionicons-v4',
// 'mdi-v5',
'fontawesome-v6',
// 'eva-icons',
// 'themify',
// 'line-awesome',
// 'roboto-font-latin-ext', // this or either 'roboto-font', NEVER both!
'roboto-font', // optional, you are not bound to it
'material-icons' // optional, you are not bound to it
],
// https://quasar.dev/quasar-cli/quasar-conf-js#Property%3A-framework
framework: {
iconSet: 'material-icons', // Quasar icon set
lang: 'en-US', // Quasar language pack
// Possible values for "all":
// * 'auto' - Auto-import needed Quasar components & directives
// (slightly higher compile time; next to minimum bundle size; most convenient)
// * false - Manually specify what to import
// (fastest compile time; minimum bundle size; most tedious)
// * true - Import everything from Quasar
// (not treeshaking Quasar; biggest bundle size; convenient)
all: 'auto',
components: [],
directives: [],
// Quasar plugins
plugins: [
'LocalStorage',
'SessionStorage',
'Notify',
'Dialog',
'AppFullscreen',
'Meta',
'Cookies'
]
},
// Full list of options: https://quasar.dev/quasar-cli/quasar-conf-js#Property%3A-build
build: {
env: {
...process.env
},
publicPath: process.env.NODE_ENV === 'production'
? '/v2/'
: (devServerConfig.publicPath || '/v2/'),
vueRouterMode: 'hash',
// rtl: false, // https://quasar.dev/options/rtl-support
// showProgress: false,
// gzip: true,
// analyze: true,
// Options below are automatically set depending on the env, set them if you want to override
// preloadChunks: false,
// extractCSS: false,
// Configuring how Webpack generates filenames for the built JavaScript files
extendWebpack (cfg) {
cfg.output = {
...cfg.output,
filename: '[name].js',
chunkFilename: '[name].js'
}
},
chainWebpack (chain) {
// Handle ESM and CommonJS modules not to encounter
// import issues with modern packages,
// especially those that provide dual ESM/CommonJS distributions or use the .mjs extension
chain.module
.rule('mjs-esm')
.test(/\.m?js$/)
.resolve.set('fullySpecified', false).end()
.type('javascript/auto')
// Basic webpack configuration
chain.resolve.fallback
.merge({
crypto: 'crypto-browserify',
stream: 'stream-browserify',
buffer: 'buffer',
vm: false,
process: false
})
// Plugins in order of dependency
// This configuration is essential for browser compatibility with Node.js modules
chain.plugin('provide')
.use(webpack.ProvidePlugin, [{
Buffer: ['buffer', 'Buffer'],
process: ['process']
}])
// removing/filtering unused Moment's locale files from final build
chain.plugin('moment-locales')
.use(MomentLocalesPlugin, [{
localesToKeep: ['en', 'de', 'es', 'fr', 'it']
}])
chain.plugin('eslint')
.use(ESLintPlugin, [{
files: ['src/**/*.js', 'src/**/*.vue'],
cache: true,
// Add these options to prevent triggering recompilation:
lintDirtyModulesOnly: true, // Only lint files that have changed
emitWarning: true, // Don't fail on warnings
emitError: false,
threads: false // Disable thread worker (can cause issues)
}])
const env = {
NODE_ENV: JSON.stringify(process.env.NODE_ENV || 'development'),
...process.env
}
chain.plugin('define')
.use(webpack.DefinePlugin, [{
// Quasar CLI specific globals
// Added to resolve errors with Quasar CLI
__QUASAR_VERSION__: '"2.18.1"', // Hardcoded version to avoid require issues
__QUASAR_SSR__: true,
__QUASAR_SSR_SERVER__: false,
__QUASAR_SSR_CLIENT__: false,
__QUASAR_SSR_PWA__: true,
'process.env': JSON.stringify(env),
// Vue specific globals
__VUE_OPTIONS_API__: true,
__VUE_PROD_DEVTOOLS__: false,
__VUE_PROD_HYDRATION_MISMATCH_DETAILS__: false
}])
}
},
// Full list of options: https://quasar.dev/quasar-cli/quasar-conf-js#Property%3A-devServer
devServer: {
https: false,
port: 8081,
open: false,
devMiddleware: {},
...(!devServerConfig.proxyAPI2localhost
? {}
: {
https: true,
proxy: [
{
context: [`!${devServerConfig.publicPath || '/v2/'}`],
target: devServerConfig.proxyAPIFromURL,
secure: false
}
],
setupMiddlewares: (middlewares, devServer) => {
// Create a constant path value to prevent reactivity issues
const basePath = devServerConfig.publicPath || '/v2/'
// Use once-only redirect handler
devServer.app.get('/', (req, res) => {
res.redirect(301, basePath)
})
// Use a constant path for static files
const publicFolderURLPath = `${basePath}statics/`
const publicFolderPath = `${process.cwd()}/src/statics`
// Use webpack's built-in static serving when possible
if (!devServer.app._staticMiddlewareApplied) {
devServer.app.use(publicFolderURLPath, express.static(publicFolderPath))
devServer.app._staticMiddlewareApplied = true
}
return middlewares
}
})
},
animations: 'all',
ssr: {
pwa: false
},
pwa: {
workboxPluginMode: 'GenerateSW',
workboxOptions: {},
manifest: {
name: 'NGCP Admin UI',
short_name: 'NGCP Admin UI',
description: 'User interface to administer the NGCP platform',
display: 'standalone',
orientation: 'portrait',
background_color: '#ffffff',
theme_color: '#006600',
icons: [
{ src: 'statics/icons/icon-128x128.png', sizes: '128x128', type: 'image/png' },
{ src: 'statics/icons/icon-192x192.png', sizes: '192x192', type: 'image/png' },
{ src: 'statics/icons/icon-256x256.png', sizes: '256x256', type: 'image/png' },
{ src: 'statics/icons/icon-384x384.png', sizes: '384x384', type: 'image/png' },
{ src: 'statics/icons/icon-512x512.png', sizes: '512x512', type: 'image/png' }
]
}
},
cordova: {
id: 'com.sipwise.ui.admin'
},
capacitor: {
hideSplashscreen: true
},
electron: {
bundler: 'packager',
packager: {},
builder: {
appId: 'ngcp-admin-ui'
},
nodeIntegration: true,
extendWebpack (/* cfg */) {
// Electron main process webpack config here (if needed)
}
}
}
})