summaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
authorTim Zallmann <tzallmann@gitlab.com>2017-06-18 07:52:18 +0000
committerkushalpandya <kushal@gitlab.com>2017-06-26 11:10:34 +0530
commit97faced4f40999107ab72a526790dc3ce89b23c3 (patch)
treee66abe4324f4615f7447d6faa8c921eb4d1dec6f /config
parent7ff357207402e0b473a975002f76bdf5795993d2 (diff)
downloadgitlab-ce-97faced4f40999107ab72a526790dc3ce89b23c3.tar.gz
Merge branch 'fix-atom-eslint' into 'master'
Fix eslint import resolver in Atom v1.18.0 See merge request !12238
Diffstat (limited to 'config')
-rw-r--r--config/webpack.config.js23
1 files changed, 7 insertions, 16 deletions
diff --git a/config/webpack.config.js b/config/webpack.config.js
index b84d6bb38d0..e643635270a 100644
--- a/config/webpack.config.js
+++ b/config/webpack.config.js
@@ -11,22 +11,13 @@ var WatchMissingNodeModulesPlugin = require('react-dev-utils/WatchMissingNodeMod
var ROOT_PATH = path.resolve(__dirname, '..');
var IS_PRODUCTION = process.env.NODE_ENV === 'production';
-var IS_DEV_SERVER = process.argv[1].indexOf('webpack-dev-server') !== -1;
+var IS_DEV_SERVER = process.argv.join(' ').indexOf('webpack-dev-server') !== -1;
var DEV_SERVER_HOST = process.env.DEV_SERVER_HOST || 'localhost';
var DEV_SERVER_PORT = parseInt(process.env.DEV_SERVER_PORT, 10) || 3808;
var DEV_SERVER_LIVERELOAD = process.env.DEV_SERVER_LIVERELOAD !== 'false';
var WEBPACK_REPORT = process.env.WEBPACK_REPORT;
var NO_COMPRESSION = process.env.NO_COMPRESSION;
-// optional dependency `node-zopfli` is unavailable on CentOS 6
-var ZOPFLI_AVAILABLE;
-try {
- require.resolve('node-zopfli');
- ZOPFLI_AVAILABLE = true;
-} catch(err) {
- ZOPFLI_AVAILABLE = false;
-}
-
var config = {
// because sqljs requires fs.
node: {
@@ -231,12 +222,12 @@ if (IS_PRODUCTION) {
// zopfli requires a lot of compute time and is disabled in CI
if (!NO_COMPRESSION) {
- config.plugins.push(
- new CompressionPlugin({
- asset: '[path].gz[query]',
- algorithm: ZOPFLI_AVAILABLE ? 'zopfli' : 'gzip',
- })
- );
+ // gracefully fall back to gzip if `node-zopfli` is unavailable (e.g. in CentOS 6)
+ try {
+ config.plugins.push(new CompressionPlugin({ algorithm: 'zopfli' }));
+ } catch(err) {
+ config.plugins.push(new CompressionPlugin({ algorithm: 'gzip' }));
+ }
}
}