File tree Expand file tree Collapse file tree 3 files changed +21
-11
lines changed Expand file tree Collapse file tree 3 files changed +21
-11
lines changed Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ function flushBatcherQueue () {
4242 runBatcherQueue ( userQueue )
4343 // dev tool hook
4444 /* istanbul ignore if */
45- if ( devtools ) {
45+ if ( devtools && config . devtools ) {
4646 devtools . emit ( 'flush' )
4747 }
4848 resetBatcherState ( )
Original file line number Diff line number Diff line change @@ -35,6 +35,13 @@ const config = {
3535
3636 warnExpressionErrors : true ,
3737
38+ /**
39+ * Whether to allow devtools inspection.
40+ * Disabled by default in production builds.
41+ */
42+
43+ devtools : process . env . NODE_ENV !== 'production' ,
44+
3845 /**
3946 * Internal flag to indicate the delimiters have been
4047 * changed.
Original file line number Diff line number Diff line change 11import Vue from './instance/vue'
22import installGlobalAPI from './global-api'
33import { inBrowser , devtools } from './util/index'
4+ import config from './config'
45
56installGlobalAPI ( Vue )
67
@@ -10,14 +11,16 @@ export default Vue
1011
1112// devtools global hook
1213/* istanbul ignore next */
13- if ( devtools ) {
14- devtools . emit ( 'init' , Vue )
15- } else if (
16- process . env . NODE_ENV !== 'production' &&
17- inBrowser && / C h r o m e \/ \d + / . test ( window . navigator . userAgent )
18- ) {
19- console . log (
20- 'Download the Vue Devtools for a better development experience:\n' +
21- 'https://github.com/vuejs/vue-devtools'
22- )
14+ if ( config . devtools ) {
15+ if ( devtools ) {
16+ devtools . emit ( 'init' , Vue )
17+ } else if (
18+ process . env . NODE_ENV !== 'production' &&
19+ inBrowser && / C h r o m e \/ \d + / . test ( window . navigator . userAgent )
20+ ) {
21+ console . log (
22+ 'Download the Vue Devtools for a better development experience:\n' +
23+ 'https://github.com/vuejs/vue-devtools'
24+ )
25+ }
2326}
You can’t perform that action at this time.
0 commit comments