Skip to content

Instantly share code, notes, and snippets.

View hawkeye64's full-sized avatar

Jeff Galbraith hawkeye64

View GitHub Profile
app:extension Installing "dotenv" Quasar App Extension +0ms
? Name of .env for development: .env
? Name of .env for production: .env
app:extension Running App Extension install script... +9s
app:extension-manager Adding "dotenv" extension prompts to /quasar.extensions.json ... +297ms
app:extension Quasar App Extension "dotenv" successfully installed. +6ms
@hawkeye64
hawkeye64 / dotenv-install-results.json
Created February 18, 2019 16:13
dotenv install results
{
"dotenv": {
"env_development": ".env",
"env_production": ".env"
}
}
@hawkeye64
hawkeye64 / ctx.js
Last active February 18, 2019 16:17
ctx/contect data
{
dev: true,
prod: false,
mode: { spa: true },
modeName: 'spa',
target: {},
targetName: undefined,
emulator: undefined,
arch: {},
archName: undefined,
@hawkeye64
hawkeye64 / index.js
Created February 18, 2019 16:20
dotenv module exports in index.js
module.exports = function (api, ctx) {
api.extendQuasarConf((conf) => {
extendWithDotenv(api, conf)
})
}
@hawkeye64
hawkeye64 / index.js
Last active February 18, 2019 16:24
dotenv index.js final
const
fs = require('fs'),
path = require('path')
const extendQuasarConf = function (api, conf) {
let envName = '.env' // default name
// get .env name based on dev or production
if (conf.ctx.dev === true) {
// your prompt data is in api.prompts
@hawkeye64
hawkeye64 / output.txt
Created February 18, 2019 16:24
dotenv file does not exist
$ quasar dev
Dev mode.......... spa
Pkg quasar........ v1.0.0-beta.2
Pkg @quasar/app... v1.0.0-beta.4
Debugging......... enabled
app:extension Running "dotenv" Quasar App Extension... +0ms
app:quasar-conf Reading quasar.conf.js +10ms
app:dev Checking listening address availability (0.0.0.0:8080)... +2ms
@hawkeye64
hawkeye64 / quasar.extensions.json
Created February 18, 2019 16:27
dotenv quasar.extensions.json
{
"dotenv": {
"env_development": ".env.development",
"env_production": ".env.production"
}
}
@hawkeye64
hawkeye64 / prompts.js
Created February 18, 2019 16:31
dotenv: additonal prompts.js data
{
type: "input",
name: "common_root_object",
message: "Name of your Common Root Object:",
default: "none"
}
@hawkeye64
hawkeye64 / index.js
Created February 18, 2019 16:32
dotenv - handling common root object
// for brevity
let target = conf.build.env
// check for common root object
if (api.prompts.common_root_object && api.prompts.common_root_object !== 'none') {
let rootObject = api.prompts.common_root_object
if (!target[rootObject]) {
target[rootObject] = {}
target = target[rootObject]
@hawkeye64
hawkeye64 / app_extension_installation.txt
Created February 18, 2019 16:35
dotenv - install with common root object
app:extension Installing "dotenv" Quasar App Extension +0ms
? Name of .env for development: .env.development
? Name of .env for production: .env.production
? Name of your Common Root Object: MyData
app:extension Running App Extension install script... +34s
app:extension-manager Adding "dotenv" extension prompts to /quasar.extensions.json ... +67ms
app:extension Quasar App Extension "dotenv" successfully installed. +1ms