diff options
| author | Jacob Schatz <jschatz1@gmail.com> | 2017-06-23 13:31:44 -0400 |
|---|---|---|
| committer | Jacob Schatz <jschatz1@gmail.com> | 2017-06-23 13:31:44 -0400 |
| commit | d04f4a9b65e2dc3fb229ee3429e6988216552c46 (patch) | |
| tree | 08daa00e770b0c2191cdb01f695223dd5c37a8a3 /config/webpack.config.js | |
| parent | d38e52fb86815df11de1b66a689caa19fa812b8c (diff) | |
| parent | 134ba0b5cb3e5bb6002595aed615bea9205807c2 (diff) | |
| download | gitlab-ce-d04f4a9b65e2dc3fb229ee3429e6988216552c46.tar.gz | |
Merge branch 'dm-tree-json' into ide Resolving conflicts.
Diffstat (limited to 'config/webpack.config.js')
| -rw-r--r-- | config/webpack.config.js | 25 |
1 files changed, 8 insertions, 17 deletions
diff --git a/config/webpack.config.js b/config/webpack.config.js index 760cde123bf..71305f3611a 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: { @@ -61,7 +52,7 @@ var config = { network: './network/network_bundle.js', notebook_viewer: './blob/notebook_viewer.js', pdf_viewer: './blob/pdf_viewer.js', - pipelines: './pipelines/index.js', + pipelines: './pipelines/pipelines_bundle.js', pipelines_details: './pipelines/pipeline_details_bundle.js', profile: './profile/profile_bundle.js', protected_branches: './protected_branches/protected_branches_bundle.js', @@ -234,12 +225,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' })); + } } } |
