Skip to content
This repository has been archived by the owner on Jan 1, 2024. It is now read-only.

Commit

Permalink
fix(webpack_config/webpack.base.js): fix default BASE_API path, fix i…
Browse files Browse the repository at this point in the history
…gnore of i18n in development
  • Loading branch information
Metnew committed Jul 15, 2017
1 parent 2611c0e commit a9b83f8
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions webpack_config/webpack.base.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,18 @@ const webpack = require('webpack')
const languages = require('../i18n')
const config = require('./config')

process.env.BASE_API = process.env.BASE_API || 'http://localhost:4000/api/v1'
process.env.BASE_API = process.env.BASE_API || '/api/v1'

let definePluginArgs = {
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV),
'process.env.BASE_API': JSON.stringify(process.env.BASE_API)
}

if (process.env.NODE_ENV === 'development') {
// XXX: don't use i18n plugin in development
definePluginArgs['i18n'] = ''
// ignore i18n plugin in development
definePluginArgs['i18n'] = (str) => {
return str
}
}

module.exports = {
Expand Down

0 comments on commit a9b83f8

Please sign in to comment.