File tree 1 file changed +12
-8
lines changed
packages/runtime-core/src
1 file changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -8,24 +8,28 @@ import { getGlobalThis } from '@vue/shared'
8
8
* istanbul-ignore-next
9
9
*/
10
10
export function initFeatureFlags ( ) {
11
- let needWarn = false
11
+ const needWarn = [ ]
12
12
13
13
if ( typeof __FEATURE_OPTIONS_API__ !== 'boolean' ) {
14
- needWarn = true
14
+ __DEV__ && needWarn . push ( `__VUE_OPTIONS_API__` )
15
15
getGlobalThis ( ) . __VUE_OPTIONS_API__ = true
16
16
}
17
17
18
18
if ( typeof __FEATURE_PROD_DEVTOOLS__ !== 'boolean' ) {
19
- needWarn = true
19
+ __DEV__ && needWarn . push ( `__VUE_PROD_DEVTOOLS__` )
20
20
getGlobalThis ( ) . __VUE_PROD_DEVTOOLS__ = false
21
21
}
22
22
23
- if ( __DEV__ && needWarn ) {
23
+ if ( __DEV__ && needWarn . length ) {
24
+ const multi = needWarn . length > 1
24
25
console . warn (
25
- `You are running the esm-bundler build of Vue. It is recommended to ` +
26
- `configure your bundler to explicitly replace feature flag globals ` +
27
- `with boolean literals to get proper tree-shaking in the final bundle. ` +
28
- `See http://link.vuejs.org/feature-flags for more details.`
26
+ `Feature flag${ multi ? `s` : `` } ${ needWarn . join ( ', ' ) } ${
27
+ multi ? `are` : `is`
28
+ } not explicitly defined. You are running the esm-bundler build of Vue, ` +
29
+ `which expects these compile-time feature flags to be globally injected ` +
30
+ `via the bundler config in order to get better tree-shaking in the ` +
31
+ `production bundle.\n\n` +
32
+ `For more details, see http://link.vuejs.org/feature-flags.`
29
33
)
30
34
}
31
35
}
You can’t perform that action at this time.
0 commit comments