automatically remove console logs

This commit is contained in:
Nolan Lawson 2018-01-27 08:22:23 -08:00
parent 687cc5c961
commit 7a510101d0
5 changed files with 15 additions and 18 deletions

View file

@ -119,9 +119,7 @@
stop('onScrollToBottom')
},
addStatuses(newStatuses) {
if (process.env.NODE_ENV !== 'production') {
console.log('addStatuses()')
}
console.log('addStatuses()')
let instanceName = this.store.get('currentInstance')
let timeline = this.get('timeline')
let statusIds = this.get('statusIds')

View file

@ -22,16 +22,12 @@
let scrollTop = this.store.get('scrollTop')
if (scrollTop > 0) {
this.observe('allVisibleItemsHaveHeight', allVisibleItemsHaveHeight => {
if (process.env.NODE_ENV !== 'production') {
console.log('allVisibleItemsHaveHeight', allVisibleItemsHaveHeight)
}
console.log('allVisibleItemsHaveHeight', allVisibleItemsHaveHeight)
if (!this.get('initializedScrollTop') && allVisibleItemsHaveHeight && node) {
this.set({'initializedScrollTop': true})
requestAnimationFrame(() => {
mark('set scrollTop')
if (process.env.NODE_ENV !== 'production') {
console.log('forcing scroll top to ', scrollTop)
}
console.log('forcing scroll top to ', scrollTop)
node.scrollTop = scrollTop
stop('set scrollTop')
})
@ -88,9 +84,7 @@
},
onFullscreenChange() {
mark('onFullscreenChange')
if (process.env.NODE_ENV !== 'production') {
console.log('is fullscreen? ', isFullscreen())
}
console.log('is fullscreen? ', isFullscreen())
this.set({ fullscreen: isFullscreen() })
stop('onFullscreenChange')
}

View file

@ -9,8 +9,7 @@ import {
} from './constants'
export function getDatabase(instanceName) {
if (!instanceName && process.env.NODE_ENV !== 'production') {
console.trace()
if (!instanceName) {
throw new Error('instanceName is undefined in getDatabase()')
}
if (databaseCache[instanceName]) {

View file

@ -106,9 +106,7 @@
try {
await this.redirectToOauth()
} catch (err) {
if (process.env.NODE_ENV !== 'production') {
console.error(err)
}
console.error(err)
let error = `${err.message || err.name}. ` +
(navigator.onLine ?
`Is this a valid Mastodon instance?` :

View file

@ -68,7 +68,15 @@ module.exports = {
//new ExtractTextPlugin('main.css'),
new LodashModuleReplacementPlugin(),
new webpack.optimize.ModuleConcatenationPlugin(),
new UglifyJSPlugin(),
new UglifyJSPlugin({
parallel: true,
uglifyOptions: {
comments: false,
compress: {
drop_console: true
}
}
}),
new BundleAnalyzerPlugin({ // generates report.html and stats.json
analyzerMode: 'static',
generateStatsFile: true,