2018-11-08 05:33:43 +08:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2018 - present Instructure, Inc.
|
|
|
|
*
|
|
|
|
* This file is part of Canvas.
|
|
|
|
*
|
|
|
|
* Canvas is free software: you can redistribute it and/or modify it under
|
|
|
|
* the terms of the GNU Affero General Public License as published by the Free
|
|
|
|
* Software Foundation, version 3 of the License.
|
|
|
|
*
|
|
|
|
* Canvas is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
|
|
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|
|
|
* A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
|
|
|
* details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Affero General Public License along
|
|
|
|
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
2017-02-03 06:07:35 +08:00
|
|
|
process.env.NODE_ENV = 'production'
|
|
|
|
|
2018-04-10 00:19:33 +08:00
|
|
|
const UglifyJsPlugin = require('uglifyjs-webpack-plugin')
|
2018-11-08 05:33:43 +08:00
|
|
|
const productionWebpackConfig = require('./frontend_build/baseWebpackConfig')
|
2016-04-12 00:13:27 +08:00
|
|
|
|
2016-03-24 05:13:21 +08:00
|
|
|
if (!process.env.JS_BUILD_NO_UGLIFY) {
|
2017-02-03 06:07:35 +08:00
|
|
|
productionWebpackConfig.plugins.push(
|
2018-04-10 00:19:33 +08:00
|
|
|
new UglifyJsPlugin({
|
2017-08-15 07:07:13 +08:00
|
|
|
sourceMap: true,
|
2018-04-10 00:19:33 +08:00
|
|
|
parallel: true,
|
|
|
|
uglifyOptions: {
|
2018-05-03 04:49:15 +08:00
|
|
|
compress: {
|
|
|
|
sequences: false // prevents it from combining a bunch of statments with ","s so it is easier to set breakpoints
|
|
|
|
},
|
2018-04-10 00:19:33 +08:00
|
|
|
ecma: 5,
|
|
|
|
output: {
|
|
|
|
comments: false,
|
2018-05-03 04:49:15 +08:00
|
|
|
semicolons: false, // not because of the holy war but because it prevents everything being on one line and is easer to read in browser
|
2018-04-10 00:19:33 +08:00
|
|
|
},
|
|
|
|
safari10: true,
|
2017-08-15 07:07:13 +08:00
|
|
|
}
|
2017-02-03 06:07:35 +08:00
|
|
|
})
|
|
|
|
)
|
2016-03-24 05:13:21 +08:00
|
|
|
}
|
2015-10-01 11:16:11 +08:00
|
|
|
|
2017-02-03 06:07:35 +08:00
|
|
|
module.exports = productionWebpackConfig
|