Skip to content

Instantly share code, notes, and snippets.

@codenamezjames
Created March 7, 2019 22:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save codenamezjames/b4ef170b849f6df6e73ded23cd2f7182 to your computer and use it in GitHub Desktop.
Save codenamezjames/b4ef170b849f6df6e73ded23cd2f7182 to your computer and use it in GitHub Desktop.
// Configuration for your app
const path = require('path')
const brand = require('./src/css/themes/default')
const envObj = require('./.env')
const env = Object.keys(envObj).reduce((last, current) => {
last[current] = JSON.stringify(envObj[current])
return last
}, {})
module.exports = function (ctx) {
const opts = {
// app boot file (/src/boot)
// --> boot files are part of "main.js"
boot: [
{ path: 'apex-charts', server: false },
{ path: 'exception-logging', server: false },
{ path: 'gtm', server: false },
'apollo',
'dark',
'i18n',
'process',
'quasar-lang-pack'
],
css: [
'app.styl'
],
extras: [
'roboto-font',
'material-icons', // optional, you are not bound to it
// 'ionicons-v4',
// 'mdi-v3',
'fontawesome-v5'
// 'eva-icons'
],
// framework: 'all', // --- includes everything; for dev only!
framework: {
components: [
'QAvatar',
'QBadge',
'QBanner',
'QBar',
'QBreadcrumbs',
'QBreadcrumbsEl',
'QBtn',
'QCard',
'QCardSection',
'QCheckbox',
'QChip',
'QDialog',
'QDrawer',
'QHeader',
'QIcon',
'QInput',
'QItem',
'QItemLabel',
'QItemSection',
'QLayout',
'QList',
'QMenu',
'QNoSsr',
'QPage',
'QPageContainer',
'QResizeObserver',
'QRouteTab',
'QScrollArea',
'QSeparator',
'QSpace',
'QTable',
'QTabPanel',
'QTabs',
'QToggle',
'QToolbar',
'QToolbarTitle'
],
directives: [
'Ripple',
'CloseDialog',
'CloseMenu'
],
// Quasar plugins
plugins: [
'Notify',
'LoadingBar'
],
config: {
brand
}
// iconSet: 'ionicons-v4'
// lang: 'de' // Quasar language
},
supportIE: true,
build: {
scopeHoisting: true,
env: ctx.dev
? { ...env, API: JSON.stringify('/graphql') }
: { ...env, API: JSON.stringify('http://graph.local:3000/graphql') }, // Production env
// vueCompiler: true,
// gzip: true,
// analyze: true,
// extractCSS: false,
extendWebpack (cfg) {
console.log('EXTENDING WEBPACK')
cfg.resolve.extensions = [ '.mjs', ...cfg.resolve.extensions, '.gql', '.graphql' ]
cfg.resolve.alias = {
...cfg.resolve.alias,
'@': path.resolve(__dirname, './src')
}
cfg.module.rules.push({
test: /\.(graphql|gql)$/,
exclude: /node_modules/,
loader: ['graphql-tag/loader']
})
cfg.module.rules.push({
enforce: 'pre',
test: /\.(js|vue)$/,
loader: 'eslint-loader',
exclude: /node_modules/,
options: {
cache: true,
fix: true
}
})
}
},
devServer: {
open: false,
port: 8765,
proxy: {
'/graphql': {
target: 'http://172.18.43.113:4000/graphql',
changeOrigin: true
}
},
historyApiFallback: { disableDotRule: true }
},
// animations: 'all' --- includes all animations
animations: ['fadeIn', 'fadeOut'],
ssr: {
pwa: false
},
pwa: {
// workboxPluginMode: 'InjectManifest',
// workboxOptions: {},
manifest: {
// name: 'Quasar App',
// short_name: 'Quasar-PWA',
// description: 'Best PWA App in town!',
display: 'standalone',
orientation: 'portrait',
background_color: '#ffffff',
theme_color: '#027be3',
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: 'org.cordova.quasar.app'
},
electron: {
// bundler: 'builder', // or 'packager'
extendWebpack (cfg) {
// do something with Electron process Webpack cfg
},
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',
// Window only
// win32metadata: { ... }
},
builder: {
// https://www.electron.build/configuration/configuration
// appId: 'quasar-app'
}
}
}
if (!ctx.mode.ssr) {
opts.build.vueRouterMode = 'history'
}
return opts
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment