Skip to content

Commit e7602ab

Browse files
committed
fix: fix absolute path for outputDir option
1 parent e970b1a commit e7602ab

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

packages/@vue/cli-service/__tests__/Service.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ test('handle option baseUrl and outputDir correctly', () => {
9191
})
9292
const service = createMockService()
9393
expect(service.projectOptions.baseUrl).toBe('https://foo.com/bar/')
94-
expect(service.projectOptions.outputDir).toBe('public')
94+
expect(service.projectOptions.outputDir).toBe('/public')
9595
})
9696

9797
test('load project options from vue.config.js', () => {

packages/@vue/cli-service/lib/Service.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,6 @@ function ensureSlash (config, key) {
336336

337337
function removeSlash (config, key) {
338338
if (typeof config[key] === 'string') {
339-
config[key] = config[key].replace(/^\/|\/$/g, '')
339+
config[key] = config[key].replace(/\/$/g, '')
340340
}
341341
}

0 commit comments

Comments
 (0)