quasar.config.js 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483
  1. /* eslint-env node */
  2. /*
  3. * This file runs in a Node context (it's NOT transpiled by Babel), so use only
  4. * the ES6 features that are supported by your Node version. https://node.green/
  5. */
  6. // Configuration for your app
  7. // https://v2.quasar.dev/quasar-cli-vite/quasar-config-js
  8. /* eslint-env node */
  9. // const ESLintPlugin = require('eslint-webpack-plugin')
  10. const { configure } = require('quasar/wrappers')
  11. // const path = require('path')
  12. const { generateWidgetList } = require('./src/widgetListGetter/index')
  13. require('dotenv').config()
  14. module.exports = configure(function (ctx) {
  15. return {
  16. // https://v2.quasar.dev/quasar-cli/supporting-ts
  17. // supportTS: false,
  18. eslint: {
  19. // fix: true,
  20. // include = [],
  21. // exclude = [],
  22. // rawOptions = {},
  23. warnings: true,
  24. errors: true
  25. },
  26. // https://v2.quasar.dev/quasar-cli/prefetch-feature
  27. preFetch: true,
  28. // app boot file (/src/boot)
  29. // --> boot files are part of "main.js"
  30. // https://v2.quasar.dev/quasar-cli/boot-files
  31. boot: [
  32. 'VuexPersistedState', // load store from localstorage to use in other boots (ex: accessToken in axios boot)
  33. // 'i18n',
  34. 'icon',
  35. 'axios',
  36. 'appConfig',
  37. 'middleware',
  38. 'bus',
  39. 'breadcrumbs',
  40. 'api-gateway',
  41. 'registerQPageBuilder',
  42. 'routesLayoutConfigs',
  43. 'GetRouteSettingFromServer',
  44. 'enums',
  45. 'gtm'
  46. ],
  47. // https://v2.quasar.dev/quasar-cli-vite/quasar-config-js#css
  48. css: [
  49. 'app.scss'
  50. ],
  51. // https://github.com/quasarframework/quasar/tree/dev/extras
  52. extras: [
  53. // 'ionicons-v4',
  54. // 'mdi-v6',
  55. // 'mdi-v5',
  56. // 'fontawesome-v6',
  57. // 'ionicons-v4',
  58. // 'eva-icons',
  59. // 'themify',
  60. // 'line-awesome',
  61. // 'roboto-font-latin-ext', // this or either 'roboto-font', NEVER both!
  62. // 'roboto-font', // optional, you are not bound to it
  63. 'material-icons' // optional, you are not bound to it
  64. ],
  65. // Full list of options: https://v2.quasar.dev/quasar-cli-vite/quasar-config-js#build
  66. build: {
  67. vueRouterMode: 'history', // available values: 'hash', 'history'
  68. productName: 'آموزش مجازی آلاء',
  69. transpile: true,
  70. // Add dependencies for transpiling with Babel (Array of string/regex)
  71. // (from node_modules, which are by default not transpiled).
  72. // Applies only if "transpile" is set to true.
  73. transpileDependencies: [
  74. 'js-abstract-model',
  75. 'quasar-template-builder',
  76. 'quasar-ui-q-page-builder'
  77. ],
  78. rtl: true, // https://v2.quasar.dev/options/rtl-support
  79. preloadChunks: true,
  80. showProgress: false,
  81. sourcemap: false,
  82. gzip: true,
  83. analyze: false,
  84. env: process.env,
  85. // https://v2.quasar.dev/quasar-cli/handling-webpack
  86. // "chain" is a webpack-chain object https://github.com/neutrinojs/webpack-chain
  87. // chainWebpack (chain, { isServer, isClient }) {
  88. // // const hashh = '[id].[name].[chunkhash]'
  89. // // chain.output.filename('js/[name]/' + hashh + '.bundle.js')
  90. // // chain.output.chunkFilename('js/[name]/' + hashh + '.chunk.js')
  91. // // chain.plugin('eslint-webpack-plugin')
  92. // // .use(ESLintPlugin, [{ extensions: ['js', 'vue'] }])
  93. // // chain.module.rule('fonts')
  94. // // .use('url-loader')
  95. // // .tap((options) => {
  96. // // options.name = 'fonts/[path][name].[ext]'
  97. // // return options
  98. // // })
  99. //
  100. // // disable cache for prod only, remove the if to disable it everywhere
  101. // // if (process.env.NODE_ENV === 'production') {
  102. // chain.module.rule('vue').uses.delete('cache-loader')
  103. // chain.module.rule('js').uses.delete('cache-loader')
  104. // chain.module.rule('ts').uses.delete('cache-loader')
  105. // chain.module.rule('tsx').uses.delete('cache-loader')
  106. // // }
  107. //
  108. // // chain.plugin('friendly-errors').tap(args => {
  109. // // // the actual transformer defined by vue-cli-3
  110. // // const vueCli3Transformer = args[0].additionalTransformers[0]
  111. // // args[0].additionalTransformers = [
  112. // // // use the actual transformer
  113. // // vueCli3Transformer,
  114. // // // add an other transformer that 'empty' the desired error
  115. // // error => {
  116. // // const regexp = /\[mini-css-extract-plugin\]\nConflicting order between:/
  117. // // if (regexp.test(error.message)) return {}
  118. // // return error
  119. // // }
  120. // // ]
  121. // // return args
  122. // // })
  123. // },
  124. // extendWebpack (cfg, { isServer, isClient }) {
  125. // cfg.resolve.alias = {
  126. // ...cfg.resolve.alias, // This adds the existing alias
  127. //
  128. // root: path.resolve(__dirname, './src'),
  129. // // '@': path.resolve(__dirname,'./src'),
  130. // // '~': path.resolve(__dirname, './src'),
  131. //
  132. // // This will make sure that the hosting test app is pointing to only one instance of vue.
  133. // vue: path.resolve(__dirname, './node_modules/vue')
  134. // // vue: path.resolve('./node_modules/vue')
  135. // }
  136. //
  137. // cfg.watchOptions = {
  138. // aggregateTimeout: 200,
  139. // poll: 1000
  140. // }
  141. // cfg.optimization.splitChunks.minSize = 10000
  142. // cfg.optimization.splitChunks.maxSize = 250000
  143. //
  144. // // cfg.plugins.push(new CopyWebpackPlugin({
  145. // // patterns: [
  146. // // {
  147. // // // from: './src-pwa/firebase-messaging-sw.js',
  148. // // from: path.resolve('./src/ServiceWorker/firebase-messaging-sw.js'),
  149. // // to: path.resolve('./dist/pwa/firebase-messaging-sw.js')
  150. // // }
  151. // // ]
  152. // // }))
  153. // },
  154. beforeDev({ quasarConf }) {
  155. generateWidgetList('./src/components/Widgets')
  156. },
  157. beforeBuild({ quasarConf }) {
  158. generateWidgetList('./src/components/Widgets')
  159. },
  160. target: {
  161. browser: ['es2019', 'edge88', 'firefox78', 'chrome87', 'safari13.1'],
  162. node: 'node16'
  163. },
  164. minify: true,
  165. polyfillModulePreload: true,
  166. extendViteConf(viteConf) {
  167. // viteConf.resolve = {
  168. // alias: {
  169. // src: path.resolve(__dirname, './src'),
  170. // boot: path.resolve(__dirname, './src/boot'),
  171. // app: path.resolve(__dirname, './'),
  172. // layouts: path.resolve(__dirname, './src/layouts'),
  173. // pages: path.resolve(__dirname, './src/pages'),
  174. // assets: path.resolve(__dirname, './src/assets'),
  175. // mixin: path.resolve(__dirname, './src/mixin'),
  176. // components: path.resolve(__dirname, './src/components'),
  177. // models: path.resolve(__dirname, './src/models'),
  178. // plugins: path.resolve(__dirname, './src/plugins'),
  179. // router: path.resolve(__dirname, './src/router'),
  180. // css: path.resolve(__dirname, './src/css'),
  181. // api: path.resolve(__dirname, './src/api')
  182. // },
  183. // extensions: ['.mjs', '.js', '.ts', '.jsx', '.tsx', '.json', '.vue'],
  184. // dedupe: [
  185. // 'vue'
  186. // ]
  187. // }
  188. },
  189. vitePlugins: [
  190. // ['@intlify/vite-plugin-vue-i18n', {
  191. // // if you want to use Vue I18n Legacy API, you need to set `compositionOnly: false`
  192. // compositionOnly: false,
  193. //
  194. // // you need to set i18n resource including paths !
  195. // include: path.resolve(__dirname, './src/i18n/**')
  196. // }]
  197. // require('@originjs/vite-plugin-commonjs').esbuildCommonjs(['minio'])
  198. // [
  199. // require('@intlify/unplugin-vue-i18n').default,
  200. // {
  201. // // if you want to use Vue I18n Legacy API, you need to set `compositionOnly: false`
  202. // // compositionOnly: false,
  203. //
  204. // // you need to set i18n resource including paths !
  205. // include: path.resolve(__dirname, './src/i18n/**')
  206. // }
  207. // ]
  208. ]
  209. },
  210. // Full list of options: https://v2.quasar.dev/quasar-cli-vite/quasar-config-js#devServer
  211. devServer: {
  212. https: true,
  213. port: 8083,
  214. open: true, // opens browser window automatically
  215. proxy: {
  216. [process.env.APP_API]: {
  217. target: process.env.APP_API_SERVER,
  218. changeOrigin: true,
  219. secure: false,
  220. rewrite: (path) => path.replace(new RegExp('^' + process.env.APP_API), '') // vite
  221. }
  222. }
  223. },
  224. // https://v2.quasar.dev/quasar-cli-vite/quasar-config-js#framework
  225. framework: {
  226. config: {
  227. notify: {
  228. timeout: 5000,
  229. position: 'top',
  230. // multiLine: true,
  231. classes: 'default-notify-class'
  232. },
  233. capacitor: {
  234. iosStatusBarPadding: true, // add the dynamic top padding on iOS mobile devices
  235. // Quasar handles app exit on mobile phone back button.
  236. // backButtonExit: true/false/'*'/['/login', '/home', '/my-page'],
  237. // On the other hand, the following completely
  238. // disables Quasar's back button management.
  239. backButton: true
  240. }
  241. },
  242. cssAddon: true,
  243. iconSet: 'material-icons', // Quasar icon set
  244. lang: 'fa', // Quasar language pack (en-US)
  245. // For special cases outside of where the auto-import strategy can have an impact
  246. // (like functional components as one of the examples),
  247. // you can manually specify Quasar components/directives to be available everywhere:
  248. //
  249. // components: [],
  250. // directives: [],
  251. // Quasar plugins
  252. plugins: [
  253. 'Meta',
  254. 'Notify',
  255. 'Loading',
  256. 'Dialog',
  257. 'Cookies' // for cart
  258. ]
  259. },
  260. // animations: 'all', // --- includes all animations
  261. // https://v2.quasar.dev/options/animations
  262. animations: [],
  263. // animations: 'all',
  264. // https://v2.quasar.dev/quasar-cli-vite/quasar-config-js#property-sourcefiles
  265. sourceFiles: {
  266. // rootComponent: 'src/App.vue',
  267. // router: 'src/router/index',
  268. // store: 'src/store/index',
  269. pwaRegisterServiceWorker: 'src-pwa/register-service-worker',
  270. pwaServiceWorker: 'src-pwa/custom-service-worker',
  271. pwaManifestFile: 'src-pwa/manifest.json'
  272. // electronMain: 'src-electron/electron-main',
  273. // electronPreload: 'src-electron/electron-preload'
  274. },
  275. // https://v2.quasar.dev/quasar-cli/developing-ssr/configuring-ssr
  276. ssr: {
  277. // ssrPwaHtmlFilename: 'offline.html', // do NOT use index.html as name!
  278. // will mess up SSR
  279. // extendSSRWebserverConf (esbuildConf) {},
  280. // extendPackageJson (json) {},
  281. pwa: true,
  282. // manualStoreHydration: true,
  283. // manualPostHydrationTrigger: true,
  284. prodPort: process.env.SSR_PORT, // The default port that the production server should use
  285. // (gets superseded if process.env.PORT is specified at runtime)
  286. // maxAge: 1000 * 60 * 60 * 24 * 30,
  287. maxAge: 1,
  288. // Tell browser when a file from the server should expire from cache (in ms)
  289. // chainWebpackWebserver (chain) {
  290. // chain.plugin('eslint-webpack-plugin')
  291. // .use(ESLintPlugin, [{ extensions: ['js'] }])
  292. // // disable cache for prod only, remove the if to disable it everywhere
  293. // // if (process.env.NODE_ENV === 'production') {
  294. // chain.module.rule('vue').uses.delete('cache-loader')
  295. // chain.module.rule('js').uses.delete('cache-loader')
  296. // chain.module.rule('ts').uses.delete('cache-loader')
  297. // chain.module.rule('tsx').uses.delete('cache-loader')
  298. // // }
  299. // },
  300. middlewares: [
  301. ctx.prod ? 'compression' : '',
  302. 'render' // keep this as last one
  303. ]
  304. },
  305. // https://v2.quasar.dev/quasar-cli/developing-pwa/configuring-pwa
  306. pwa: {
  307. workboxMode: 'injectManifest', // 'generateSW' or 'injectManifest'
  308. injectPwaMetaTags: true,
  309. swFilename: 'sw.js',
  310. manifestFilename: 'manifest.json',
  311. useCredentialsForManifestTag: false,
  312. manifest: {
  313. name: 'مدرسه آنلاین آلاء',
  314. short_name: 'آلاء',
  315. start_url: '/',
  316. background_color: '#FFFFFF',
  317. theme_color: '#ffc107',
  318. description: 'آموزش مجازی آلاء',
  319. display: 'standalone',
  320. orientation: 'portrait',
  321. icons: [
  322. {
  323. src: 'icons/icon-72x72.png',
  324. sizes: '72x72',
  325. type: 'image/png',
  326. purpose: 'maskable any'
  327. },
  328. {
  329. src: 'icons/icon-96x96.png',
  330. sizes: '96x96',
  331. type: 'image/png',
  332. purpose: 'maskable any'
  333. },
  334. {
  335. src: 'icons/icon-128x128.png',
  336. sizes: '128x128',
  337. type: 'image/png',
  338. purpose: 'maskable any'
  339. },
  340. {
  341. src: 'icons/icon-144x144.png',
  342. sizes: '144x144',
  343. type: 'image/png',
  344. purpose: 'maskable any'
  345. },
  346. {
  347. src: 'icons/icon-152x152.png',
  348. sizes: '152x152',
  349. type: 'image/png',
  350. purpose: 'maskable any'
  351. },
  352. {
  353. src: 'icons/icon-192x192.png',
  354. sizes: '192x192',
  355. type: 'image/png',
  356. purpose: 'maskable any'
  357. },
  358. {
  359. src: 'icons/icon-384x384.png',
  360. sizes: '384x384',
  361. type: 'image/png',
  362. purpose: 'maskable any'
  363. },
  364. {
  365. src: 'icons/icon-512x512.png',
  366. sizes: '512x512',
  367. type: 'image/png',
  368. purpose: 'maskable any'
  369. }
  370. ]
  371. },
  372. extendGenerateSWOptions (cfg) {
  373. cfg.skipWaiting = false
  374. cfg.clientsClaim = false
  375. }
  376. },
  377. // Full list of options: https://v2.quasar.dev/quasar-cli/developing-cordova-apps/configuring-cordova
  378. cordova: {
  379. // noIosLegacyBuildFlag: true, // uncomment only if you know what you are doing
  380. },
  381. // Full list of options: https://v2.quasar.dev/quasar-cli/developing-capacitor-apps/configuring-capacitor
  382. capacitor: {
  383. // (Optional!)
  384. hideSplashscreen: false, // disables auto-hiding the Splashscreen by Quasar CLI
  385. // (Optional!)
  386. capacitorCliPreparationParams: ['sync', ctx.targetName]
  387. },
  388. bin: {
  389. linuxAndroidStudio: process.env.LINUX_ANDROID_STUDIO
  390. },
  391. // Full list of options: https://v2.quasar.dev/quasar-cli/developing-electron-apps/configuring-electron
  392. electron: {
  393. // extendElectronMainConf (esbuildConf)
  394. // extendElectronPreloadConf (esbuildConf)
  395. inspectPort: 5858,
  396. bundler: 'packager', // 'packager' or 'builder'
  397. packager: {
  398. // https://github.com/electron-userland/electron-packager/blob/master/docs/api.md#options
  399. // OS X / Mac App Store
  400. // appBundleId: '',
  401. // appCategoryType: '',
  402. // osxSign: '',
  403. // protocol: 'myapp://path',
  404. // Windows only
  405. // win32metadata: { ... }
  406. },
  407. builder: {
  408. // https://www.electron.build/configuration/configuration
  409. appId: 'alaatv-front-vite'
  410. }
  411. // // "chain" is a webpack-chain object https://github.com/neutrinojs/webpack-chain
  412. // chainWebpackMain (chain) {
  413. // chain.plugin('eslint-webpack-plugin')
  414. // .use(ESLintPlugin, [{ extensions: ['js'] }])
  415. // },
  416. // // "chain" is a webpack-chain object https://github.com/neutrinojs/webpack-chain
  417. // chainWebpackPreload (chain) {
  418. // chain.plugin('eslint-webpack-plugin')
  419. // .use(ESLintPlugin, [{ extensions: ['js'] }])
  420. // }
  421. },
  422. // Full list of options: https://v2.quasar.dev/quasar-cli-vite/developing-browser-extensions/configuring-bex
  423. bex: {
  424. contentScripts: [
  425. 'my-content-script'
  426. ]
  427. // extendBexScriptsConf (esbuildConf) {}
  428. // extendBexManifestJson (json) {}
  429. }
  430. }
  431. })