Skip to content

Commit

Permalink
fix(ui): reset webpack.config.js service on correct CWD, closes #1555
Browse files Browse the repository at this point in the history
  • Loading branch information
Guillaume Chau committed Jun 14, 2018
1 parent 29fcee7 commit dc2f8e8
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/@vue/cli-service/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions packages/@vue/cli-ui/src/graphql-api/connectors/cwd.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 === '.'
Expand Down

0 comments on commit dc2f8e8

Please sign in to comment.