Skip to content

Commit 8654e82

Browse files
authored
fix(cli-service): respect the existing 'devtool' (#6402)
Respect the existing 'devtool' when running dev server Fixes #6398
1 parent 7838c0d commit 8654e82

File tree

1 file changed

+5
-2
lines changed
  • packages/@vue/cli-service/lib/commands

1 file changed

+5
-2
lines changed

packages/@vue/cli-service/lib/commands/serve.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ const defaults = {
1313
https: false
1414
}
1515

16+
/** @type {import('@vue/cli-service').ServicePlugin} */
1617
module.exports = (api, options) => {
1718
api.registerCommand('serve', {
1819
description: 'start development server',
@@ -50,8 +51,10 @@ module.exports = (api, options) => {
5051
// configs that only matters for dev server
5152
api.chainWebpack(webpackConfig => {
5253
if (process.env.NODE_ENV !== 'production' && process.env.NODE_ENV !== 'test') {
53-
webpackConfig
54-
.devtool('eval-cheap-module-source-map')
54+
if (!webpackConfig.get('devtool')) {
55+
webpackConfig
56+
.devtool('eval-cheap-module-source-map')
57+
}
5558

5659
webpackConfig
5760
.plugin('hmr')

0 commit comments

Comments
 (0)