mirror of
https://github.com/vuejs/vue-cli.git
synced 2026-04-26 14:58:30 -05:00
fix(ui): reset webpack.config.js service on correct CWD, closes #1555
This commit is contained in:
@@ -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 === '.'
|
||||
|
||||
Reference in New Issue
Block a user