Skip to content

Commit aa6f7b4

Browse files
committedDec 28, 2016
add production tips info
1 parent 6b1755a commit aa6f7b4

File tree

2 files changed

+18
-4
lines changed

2 files changed

+18
-4
lines changed
 

Diff for: ‎src/entries/web-runtime.js

+11-2
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,15 @@ Vue.prototype.$mount = function (
3737
return this._mount(el, hydrating)
3838
}
3939

40+
if (process.env.NODE_ENV !== 'production' &&
41+
inBrowser && typeof console !== 'undefined') {
42+
console[console.info ? 'info' : 'log'](
43+
`You are running Vue in development mode.\n` +
44+
`Make sure to turn on production mode when deploying for production.\n` +
45+
`See more tips at https://vuejs.org/guide/deployment.html`
46+
)
47+
}
48+
4049
// devtools global hook
4150
/* istanbul ignore next */
4251
setTimeout(() => {
@@ -47,8 +56,8 @@ setTimeout(() => {
4756
process.env.NODE_ENV !== 'production' &&
4857
inBrowser && !isEdge && /Chrome\/\d+/.test(window.navigator.userAgent)
4958
) {
50-
console.log(
51-
'Download the Vue Devtools for a better development experience:\n' +
59+
console[console.info ? 'info' : 'log'](
60+
'Download the Vue Devtools extension for a better development experience:\n' +
5261
'https://github.com/vuejs/vue-devtools'
5362
)
5463
}

Diff for: ‎test/helpers/to-have-been-warned.js

+7-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
1+
function noop () {}
2+
13
if (typeof console === 'undefined') {
24
window.console = {
3-
warn: function () {},
4-
error: function () {}
5+
warn: noop,
6+
error: noop
57
}
68
}
79

10+
// avoid info messages during test
11+
console.info = noop
12+
813
let asserted
914
function hasWarned (msg) {
1015
var count = console.error.calls.count()

0 commit comments

Comments
 (0)