-
Notifications
You must be signed in to change notification settings - Fork 14
/
quasar.config.js
488 lines (430 loc) · 16 KB
/
quasar.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
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
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
/* 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://v2.quasar.dev/quasar-cli-vite/quasar-config-js
require('dotenv').config()
const { configure } = require('quasar/wrappers')
const VitePlugin = require('@sentry/vite-plugin')
const { generateWidgetList } = require('./src/widgetListGetter/index.js')
const sentryVitePlugin = VitePlugin.sentryVitePlugin
module.exports = configure(function (ctx) {
return {
eslint: {
// fix: true,
// include: [],
// exclude: [],
// rawOptions: {},
warnings: true,
errors: true
},
// https://v2.quasar.dev/quasar-cli/prefetch-feature
preFetch: true,
// app boot file (/src/boot)
// --> boot files are part of "main.js"
// https://v2.quasar.dev/quasar-cli/boot-files
boot: [
'VuexPersistedState', // load store from localstorage to use in other boots (ex: accessToken in axios boot)
// // 'i18n',
'icon',
'axios',
'appConfig',
'middleware',
// 'i18n',
'bus',
'breadcrumbs',
'api-gateway',
'registerQPageBuilder',
'routesLayoutConfigs'
// 'GetRouteSettingFromServer',
// 'enums'
],
// https://v2.quasar.dev/quasar-cli-vite/quasar-config-js#css
css: [
'app.scss'
],
// https://github.com/quasarframework/quasar/tree/dev/extras
extras: [
// 'ionicons-v4',
'mdi-v6',
// '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
],
// Full list of options: https://v2.quasar.dev/quasar-cli-vite/quasar-config-js#build
build: {
productName: 'سوالا',
target: {
browser: ['es2019', 'edge88', 'firefox78', 'chrome87', 'safari13.1'],
node: 'node16'
},
vueRouterMode: 'history', // available values: 'hash', 'history'
// vueRouterBase,
// vueDevtools,
// vueOptionsAPI: false,
transpile: true,
// Add dependencies for transpiling with Babel (Array of string/regex)
// (from node_modules, which are by default not transpiled).
// Applies only if "transpile" is set to true.
transpileDependencies: [
'js-abstract-model',
'quasar-template-builder',
'quasar-ui-q-page-builder'
],
rtl: true, // https://v2.quasar.dev/options/rtl-support
preloadChunks: false,
showProgress: true,
gzip: true,
analyze: true,
// rebuildCache: true, // rebuilds Vite/linter/etc cache on startup
env: process.env,
// https://v2.quasar.dev/quasar-cli/handling-webpack
// "chain" is a webpack-chain object https://github.com/neutrinojs/webpack-chain
// chainWebpack (chain, { isServer, isClient }) {
// // const hashh = '[id].[name].[chunkhash]'
// // chain.output.filename('js/[name]/' + hashh + '.bundle.js')
// // chain.output.chunkFilename('js/[name]/' + hashh + '.chunk.js')
// // chain.plugin('eslint-webpack-plugin')
// // .use(ESLintPlugin, [{ extensions: ['js', 'vue'] }])
// // chain.module.rule('fonts')
// // .use('url-loader')
// // .tap((options) => {
// // options.name = 'fonts/[path][name].[ext]'
// // return options
// // })
//
// // disable cache for prod only, remove the if to disable it everywhere
// // if (process.env.NODE_ENV === 'production') {
// chain.module.rule('vue').uses.delete('cache-loader')
// chain.module.rule('js').uses.delete('cache-loader')
// chain.module.rule('ts').uses.delete('cache-loader')
// chain.module.rule('tsx').uses.delete('cache-loader')
// // }
//
// // chain.plugin('friendly-errors').tap(args => {
// // // the actual transformer defined by vue-cli-3
// // const vueCli3Transformer = args[0].additionalTransformers[0]
// // args[0].additionalTransformers = [
// // // use the actual transformer
// // vueCli3Transformer,
// // // add an other transformer that 'empty' the desired error
// // error => {
// // const regexp = /\[mini-css-extract-plugin\]\nConflicting order between:/
// // if (regexp.test(error.message)) return {}
// // return error
// // }
// // ]
// // return args
// // })
// },
// extendWebpack (cfg, { isServer, isClient }) {
// cfg.resolve.alias = {
// ...cfg.resolve.alias, // This adds the existing alias
//
// root: path.resolve(__dirname, './src'),
// // '@': path.resolve(__dirname,'./src'),
// // '~': path.resolve(__dirname, './src'),
//
// // This will make sure that the hosting test app is pointing to only one instance of vue.
// vue: path.resolve(__dirname, './node_modules/vue')
// // vue: path.resolve('./node_modules/vue')
// }
//
// cfg.watchOptions = {
// aggregateTimeout: 200,
// poll: 1000
// }
// cfg.optimization.splitChunks.minSize = 10000
// cfg.optimization.splitChunks.maxSize = 250000
//
// // cfg.plugins.push(new CopyWebpackPlugin({
// // patterns: [
// // {
// // // from: './src-pwa/firebase-messaging-sw.js',
// // from: path.resolve('./src/ServiceWorker/firebase-messaging-sw.js'),
// // to: path.resolve('./dist/pwa/firebase-messaging-sw.js')
// // }
// // ]
// // }))
// },
beforeDev({ quasarConf }) {
generateWidgetList('./src/components/Widgets')
},
beforeBuild({ quasarConf }) {
generateWidgetList('./src/components/Widgets')
},
// publicPath: '/',
// rawDefine: {}
// ignorePublicFolder: true,
// minify: false,
// polyfillModulePreload: true,
// distDir
// extendViteConf (viteConf) {},
// viteVuePluginOptions: {},
vitePlugins: [
// // Put the Sentry vite plugin after all other plugins
sentryVitePlugin({
telemetry: false,
include: ['./dist'],
ignore: ['node_modules', 'quasar.config.js'],
org: process.env.SENTRY_ORG,
project: process.env.SENTRY_PROJECT,
authToken: process.env.SENTRY_AUTH_TOKEN,
// configFile: 'entry.properties',
// stripPrefix: ['dist/js'],
urlSuffix: '.map',
validate: true,
rewrite: true,
attachCommits: true,
includeSourceMaps: true
})
// ['@intlify/vite-plugin-vue-i18n', {
// // if you want to use Vue I18n Legacy API, you need to set `compositionOnly: false`
// compositionOnly: false,
//
// // you need to set i18n resource including paths !
// include: path.resolve(__dirname, './src/i18n/**')
// }]
// require('@originjs/vite-plugin-commonjs').esbuildCommonjs(['minio'])
// [
// require('@intlify/unplugin-vue-i18n').default,
// {
// // if you want to use Vue I18n Legacy API, you need to set `compositionOnly: false`
// // compositionOnly: false,
//
// // you need to set i18n resource including paths !
// include: path.resolve(__dirname, './src/i18n/**')
// }
// ]
]
},
// Full list of options: https://v2.quasar.dev/quasar-cli-vite/quasar-config-js#devServer
devServer: {
https: false,
port: 8083,
open: true, // opens browser window automatically
proxy: {
[process.env.AUTH_API]: {
target: process.env.AUTH_API_SERVER,
changeOrigin: true,
secure: false,
rewrite: (path) => path.replace(new RegExp('^' + process.env.AUTH_API), '') // vite
},
[process.env.AAA_API]: {
target: process.env.AAA_API_SERVER,
changeOrigin: true,
secure: false,
rewrite: (path) => path.replace(new RegExp('^' + process.env.AAA_API), '') // vite
},
[process.env.TREE_API]: {
target: process.env.TREE_API_SERVER,
changeOrigin: true,
secure: false,
rewrite: (path) => path.replace(new RegExp('^' + process.env.TREE_API), '') // vite
},
[process.env.TAG_API]: {
target: process.env.TAG_API_SERVER,
changeOrigin: true,
secure: false,
rewrite: (path) => path.replace(new RegExp('^' + process.env.TAG_API), '') // vite
}
}
},
// https://v2.quasar.dev/quasar-cli-vite/quasar-config-js#framework
framework: {
config: {
notify: {
timeout: 5000,
position: 'top',
// multiLine: true,
classes: 'default-notify-class'
},
capacitor: {
iosStatusBarPadding: true, // add the dynamic top padding on iOS mobile devices
// Quasar handles app exit on mobile phone back button.
// backButtonExit: true/false/'*'/['/login', '/home', '/my-page'],
// On the other hand, the following completely
// disables Quasar's back button management.
backButton: true
}
},
cssAddon: true,
iconSet: 'material-icons', // Quasar icon set
lang: 'fa', // Quasar language pack (en-US)
// For special cases outside of where the auto-import strategy can have an impact
// (like functional components as one of the examples),
// you can manually specify Quasar components/directives to be available everywhere:
//
// components: [],
// directives: [],
// Quasar plugins
plugins: [
'Meta',
'Notify',
'Loading',
'Dialog',
'Cookies' // for cart
]
},
// animations: 'all', // --- includes all animations
// https://v2.quasar.dev/options/animations
animations: [],
// https://v2.quasar.dev/quasar-cli-vite/quasar-config-js#property-sourcefiles
// sourceFiles: {
// rootComponent: 'src/App.vue',
// router: 'src/router/index',
// store: 'src/store/index',
// registerServiceWorker: 'src-pwa/register-service-worker',
// serviceWorker: 'src-pwa/custom-service-worker',
// pwaManifestFile: 'src-pwa/manifest.json',
// electronMain: 'src-electron/electron-main',
// electronPreload: 'src-electron/electron-preload'
// },
// https://v2.quasar.dev/quasar-cli/developing-ssr/configuring-ssr
ssr: {
// ssrPwaHtmlFilename: 'offline.html', // do NOT use index.html as name!
// will mess up SSR
// extendSSRWebserverConf (esbuildConf) {},
// extendPackageJson (json) {},
pwa: false,
// manualStoreHydration: true,
// manualPostHydrationTrigger: true,
prodPort: process.env.SSR_PORT, // The default port that the production server should use
// (gets superseded if process.env.PORT is specified at runtime)
// maxAge: 1000 * 60 * 60 * 24 * 30,
maxAge: 1,
// Tell browser when a file from the server should expire from cache (in ms)
// chainWebpackWebserver (chain) {
// chain.plugin('eslint-webpack-plugin')
// .use(ESLintPlugin, [{ extensions: ['js'] }])
// // disable cache for prod only, remove the if to disable it everywhere
// // if (process.env.NODE_ENV === 'production') {
// chain.module.rule('vue').uses.delete('cache-loader')
// chain.module.rule('js').uses.delete('cache-loader')
// chain.module.rule('ts').uses.delete('cache-loader')
// chain.module.rule('tsx').uses.delete('cache-loader')
// // }
// },
middlewares: [
ctx.prod ? 'compression' : '',
'render' // keep this as last one
]
},
// https://v2.quasar.dev/quasar-cli/developing-pwa/configuring-pwa
pwa: {
workboxPluginMode: 'InjectManifest', // 'GenerateSW' or 'InjectManifest'
workboxOptions: {}, // only for GenerateSW
// // for the custom service worker ONLY (/src-pwa/custom-service-worker.[js|ts])
// // if using workbox in InjectManifest mode
// chainWebpackCustomSW (chain) {
// chain.plugin('eslint-webpack-plugin')
// .use(ESLintPlugin, [{ extensions: ['js'] }])
// },
manifest: {
name: 'مدرسه آنلاین آلاء',
short_name: 'آلاء',
background_color: '#FFFFFF',
theme_color: '#ffc107',
description: 'آموزش مجازی آلاء',
display: 'standalone',
orientation: 'portrait',
icons: [
{
src: 'icons/icon-128x128.png',
sizes: '128x128',
type: 'image/png'
},
{
src: 'icons/icon-192x192.png',
sizes: '192x192',
type: 'image/png'
},
{
src: 'icons/icon-256x256.png',
sizes: '256x256',
type: 'image/png'
},
{
src: 'icons/icon-384x384.png',
sizes: '384x384',
type: 'image/png'
},
{
src: 'icons/icon-512x512.png',
sizes: '512x512',
type: 'image/png'
}
]
},
injectPwaMetaTags: true,
swFilename: 'sw.js',
manifestFilename: 'manifest.json',
useCredentialsForManifestTag: false
// useFilenameHashes: true,
// extendGenerateSWOptions (cfg) {}
// extendInjectManifestOptions (cfg) {},
// extendManifestJson (json) {}
// extendPWACustomSWConf (esbuildConf) {}
},
// Full list of options: https://v2.quasar.dev/quasar-cli/developing-cordova-apps/configuring-cordova
cordova: {
// noIosLegacyBuildFlag: true, // uncomment only if you know what you are doing
},
// Full list of options: https://v2.quasar.dev/quasar-cli/developing-capacitor-apps/configuring-capacitor
capacitor: {
// (Optional!)
hideSplashscreen: false, // disables auto-hiding the Splashscreen by Quasar CLI
// (Optional!)
capacitorCliPreparationParams: ['sync', ctx.targetName]
},
bin: {
linuxAndroidStudio: '/snap/android-studio/current/android-studio/bin/studio.sh'
},
// Full list of options: https://v2.quasar.dev/quasar-cli/developing-electron-apps/configuring-electron
electron: {
// extendElectronMainConf (esbuildConf)
// extendElectronPreloadConf (esbuildConf)
inspectPort: 5858,
bundler: 'packager', // 'packager' or 'builder'
packager: {
// https://github.com/electron-userland/electron-packager/blob/master/docs/api.md#options
// OS X / Mac App Store
// appBundleId: '',
// appCategoryType: '',
// osxSign: '',
// protocol: 'myapp://path',
// Windows only
// win32metadata: { ... }
},
builder: {
// https://www.electron.build/configuration/configuration
appId: 'alaatv-front-vite'
}
// // "chain" is a webpack-chain object https://github.com/neutrinojs/webpack-chain
// chainWebpackMain (chain) {
// chain.plugin('eslint-webpack-plugin')
// .use(ESLintPlugin, [{ extensions: ['js'] }])
// },
// // "chain" is a webpack-chain object https://github.com/neutrinojs/webpack-chain
// chainWebpackPreload (chain) {
// chain.plugin('eslint-webpack-plugin')
// .use(ESLintPlugin, [{ extensions: ['js'] }])
// }
},
// Full list of options: https://v2.quasar.dev/quasar-cli-vite/developing-browser-extensions/configuring-bex
bex: {
contentScripts: [
'my-content-script'
]
// extendBexScriptsConf (esbuildConf) {}
// extendBexManifestJson (json) {}
}
}
})