fix(ui): reset webpack.config.js service on correct CWD, closes #1555

This commit is contained in:
Guillaume Chau
2018-06-15 01:28:20 +02:00
parent 29fcee73bd
commit dc2f8e8ff8
3 changed files with 3 additions and 1 deletions
+1 -1
View File
@@ -3,7 +3,7 @@
let service = process.VUE_CLI_SERVICE
if (!service) {
if (!service || process.env.VUE_CLI_API_MODE) {
const Service = require('./lib/Service')
service = new Service(process.env.VUE_CLI_CONTEXT || process.cwd())
service.init(process.env.VUE_CLI_MODE || process.env.NODE_ENV)
@@ -6,6 +6,7 @@ module.exports = {
get: () => cwd,
set: (value, context) => {
cwd = value
process.env.VUE_CLI_CONTEXT = value
context.pubsub.publish(channels.CWD_CHANGED, { cwdChanged: value })
try {
process.chdir(value)
@@ -246,6 +246,7 @@ async function create (input, context) {
})
const targetDir = path.join(cwd.get(), input.folder)
cwd.set(targetDir, context)
creator.context = targetDir
const inCurrent = input.folder === '.'