chore: add quasar config capabilities

pull/6775/head
Nicolas Giard 3 years ago
parent 50d774fa98
commit 3aafe116ac
No known key found for this signature in database
GPG Key ID: 85061B8F9D55B7C8

@ -131,3 +131,12 @@ scheduler:
# Maximum number of workers to run background cpu-intensive jobs. # Maximum number of workers to run background cpu-intensive jobs.
# Leave 'auto' to use number of CPU cores as maximum. # Leave 'auto' to use number of CPU cores as maximum.
workers: auto workers: auto
# ---------------------------------------------------------------------
# Dev Mode
# ---------------------------------------------------------------------
# Settings when running in dev mode only
dev:
port: 3001
hmrClientPort: 3001

@ -10,8 +10,15 @@
const { configure } = require('quasar/wrappers') const { configure } = require('quasar/wrappers')
const path = require('path') const path = require('path')
const yaml = require('js-yaml')
const fs = require('fs')
module.exports = configure(function (/* ctx */) { module.exports = configure(function (/* ctx */) {
const userConfig = {
dev: { port: 3001, hmrClientPort: 3001 },
...yaml.load(fs.readFileSync(path.resolve(__dirname, '../config.yml'), 'utf8'))
}
return { return {
eslint: { eslint: {
fix: true, fix: true,
@ -102,12 +109,15 @@ module.exports = configure(function (/* ctx */) {
devServer: { devServer: {
// https: true // https: true
open: false, // opens browser window automatically open: false, // opens browser window automatically
port: 3001, port: userConfig.dev.port,
proxy: { proxy: {
'/_graphql': 'http://127.0.0.1:3000/_graphql', '/_graphql': `http://127.0.0.1:${userConfig.port}/_graphql`,
'/_site': 'http://127.0.0.1:3000', '/_site': `http://127.0.0.1:${userConfig.port}`,
'/_thumb': 'http://127.0.0.1:3000', '/_thumb': `http://127.0.0.1:${userConfig.port}`,
'/_user': 'http://127.0.0.1:3000' '/_user': `http://127.0.0.1:${userConfig.port}`
},
hmr: {
clientPort: userConfig.dev.hmrClientPort
} }
}, },

Loading…
Cancel
Save