Skip to content

Commit 8037647

Browse files
committed
chore: add warning when using --modern with non app build
ref vuejs#1940
1 parent 5b43438 commit 8037647

File tree

1 file changed

+8
-0
lines changed
  • packages/@vue/cli-service/lib/commands/build

1 file changed

+8
-0
lines changed

packages/@vue/cli-service/lib/commands/build/index.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,14 @@ module.exports = (api, options) => {
6161
delete process.env.VUE_CLI_MODERN_MODE
6262
delete process.env.VUE_CLI_MODERN_BUILD
6363
} else {
64+
if (args.modern) {
65+
const { warn } = require('@vue/cli-shared-utils')
66+
warn(
67+
`Modern mode only works with default target (app). ` +
68+
`For libraries or web components, use the browserslist ` +
69+
`config to specify target browsers.`
70+
)
71+
}
6472
await build(args, api, options)
6573
}
6674
delete process.env.VUE_CLI_BUILD_TARGET

0 commit comments

Comments
 (0)