1
1
mirror of https://github.com/leon-ai/leon.git synced 2024-11-28 04:04:58 +03:00

Merge branch 'envify' into develop

This commit is contained in:
Louistiti 2019-02-24 15:46:41 +08:00
commit 0d3caceafd
4 changed files with 18 additions and 2 deletions

View File

@ -10,8 +10,8 @@ import { onkeydowndocument, onkeydowninput } from './onkeydown.es6'
const config = {
app: 'webapp',
server_host: 'localhost',
server_port: 1337,
server_host: process.env.LEON_SERVER_HOST,
server_port: process.env.LEON_SERVER_PORT,
min_decibels: -40, // Noise detection sensitivity
max_blank_time: 1000 // Maximum time to consider a blank (ms)
}

10
package-lock.json generated
View File

@ -3898,6 +3898,16 @@
"resolved": "https://registry.npmjs.org/ent/-/ent-2.2.0.tgz",
"integrity": "sha1-6WQhkyWiHQX0RGai9obtbOX13R0="
},
"envify": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/envify/-/envify-4.1.0.tgz",
"integrity": "sha512-IKRVVoAYr4pIx4yIWNsz9mOsboxlNXiu7TNBnem/K/uTHdkyzXWDzHCK7UTolqBbgaBz0tQHsD3YNls0uIIjiw==",
"dev": true,
"requires": {
"esprima": "^4.0.0",
"through": "~2.3.4"
}
},
"error-ex": {
"version": "1.3.2",
"resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz",

View File

@ -79,6 +79,7 @@
"browserify": "^14.4.0",
"cli-spinner": "^0.2.8",
"dev-ip": "^1.0.1",
"envify": "^4.1.0",
"eslint": "^3.19.0",
"eslint-config-airbnb-base": "^11.2.0",
"eslint-import-resolver-babel-module": "^4.0.0",

View File

@ -1,5 +1,7 @@
import fs from 'fs'
import browserify from 'browserify'
import envify from 'envify/custom'
import dotenv from 'dotenv'
import log from '@/helpers/log'
@ -7,8 +9,11 @@ import log from '@/helpers/log'
* Build web app
*/
export default () => new Promise((resolve) => {
// read .env file from leon root directory
dotenv.config()
browserify('app/js/main.es6.js')
.transform('babelify')
.transform(envify(process.env))
.bundle()
.on('error', err => log.error(`[${err.name}] ${err.message}`))
.pipe(fs.createWriteStream('app/js/main.js'))