quasar.config.js 15 KB

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