Skip to content

Commit

Permalink
fix env
Browse files Browse the repository at this point in the history
  • Loading branch information
fupengl committed Dec 10, 2018
1 parent 06cafef commit b9d4450
Show file tree
Hide file tree
Showing 4 changed files with 191 additions and 140 deletions.
7 changes: 2 additions & 5 deletions config/dev.env.js
@@ -1,7 +1,4 @@
const merge = require('webpack-merge');
const prodEnv = require('./prod.env');

module.exports = merge(prodEnv, {
module.exports = {
ENV: '"development"',
BASE_API: "'http://localhost:8081'"
});
};
14 changes: 3 additions & 11 deletions config/index.js
@@ -1,20 +1,12 @@
const path = require('path');

module.exports = {
entry: 'src/app.ts',
alias: {
'style': resolve('src/styles/index.scss')
'style': 'src/styles/index.scss'
},
build: {
env: require('./prod.env'),
assetsSubDirectory: 'static',
env: require('./prod.env')
},
dev: {
env: require('./dev.env'),
assetsSubDirectory: 'static',
env: require('./dev.env')
}
};

function resolve(dir) {
return path.join(__dirname, '../', dir);
};
5 changes: 4 additions & 1 deletion package.json
Expand Up @@ -7,6 +7,8 @@
"scripts": {
"build": "mpc build",
"start": "mpc serve",
"dev:prod": "cross-env CONF=build mpc serve",
"build:dev": "cross-env CONF=dev mpc build",
"sort": "npx sort-package-json",
"test": "echo \"Error: no test specified\" && exit 1"
},
Expand All @@ -16,11 +18,12 @@
"miniprogram-navigation-bar": "0.0.4",
"miniprogram-recycle-view": "0.0.6",
"miniprogram-slide-view": "0.0.3",
"wapp-cli": "^0.0.61"
"wapp-cli": "^0.0.63"
},
"devDependencies": {
"@types/weixin-app": "^2.2.11",
"babel-eslint": "^10.0.1",
"cross-env": "^5.2.0",
"eslint": "^5.8.0",
"eslint-config-standard": "^12.0.0",
"eslint-loader": "^2.1.1",
Expand Down

0 comments on commit b9d4450

Please sign in to comment.