quasar.config.js 15 KB

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