diff options
author | Fabio Berger <me@fabioberger.com> | 2018-03-14 23:37:09 +0800 |
---|---|---|
committer | Fabio Berger <me@fabioberger.com> | 2018-03-14 23:37:09 +0800 |
commit | 56eeea1e633b3d0b41b50df6dcd8f76d284d5c73 (patch) | |
tree | d0405e6aa9244c555ee8f17f7bea275ddfcdea66 | |
parent | 642a2cf165abe527bba015b3a923d9624d1b1a3d (diff) | |
download | dexon-0x-contracts-56eeea1e633b3d0b41b50df6dcd8f76d284d5c73.tar dexon-0x-contracts-56eeea1e633b3d0b41b50df6dcd8f76d284d5c73.tar.gz dexon-0x-contracts-56eeea1e633b3d0b41b50df6dcd8f76d284d5c73.tar.bz2 dexon-0x-contracts-56eeea1e633b3d0b41b50df6dcd8f76d284d5c73.tar.lz dexon-0x-contracts-56eeea1e633b3d0b41b50df6dcd8f76d284d5c73.tar.xz dexon-0x-contracts-56eeea1e633b3d0b41b50df6dcd8f76d284d5c73.tar.zst dexon-0x-contracts-56eeea1e633b3d0b41b50df6dcd8f76d284d5c73.zip |
Add fix to webpack for issue: https://github.com/trufflesuite/ganache-core/issues/84 and prettier the configs
-rw-r--r-- | packages/website/webpack.config.js | 48 |
1 files changed, 26 insertions, 22 deletions
diff --git a/packages/website/webpack.config.js b/packages/website/webpack.config.js index c436888bd..e4cb1301c 100644 --- a/packages/website/webpack.config.js +++ b/packages/website/webpack.config.js @@ -11,10 +11,7 @@ module.exports = { }, devtool: 'source-map', resolve: { - modules: [ - path.join(__dirname, '/ts'), - 'node_modules', - ], + modules: [path.join(__dirname, '/ts'), 'node_modules'], extensions: ['.ts', '.tsx', '.js', '.jsx', '.json', '.md'], alias: { ts: path.join(__dirname, '/ts'), @@ -22,6 +19,10 @@ module.exports = { md: path.join(__dirname, '/md'), }, }, + // HACK: Temporary fix for this issue: https://github.com/trufflesuite/ganache-core/issues/84 + node: { + fs: 'empty', + }, module: { rules: [ { @@ -62,25 +63,28 @@ module.exports = { from: /^\/docs\/.*$/, to: function() { return 'index.html'; - } - } - ] + }, + }, + ], }, disableHostCheck: true, }, - plugins: process.env.NODE_ENV === 'production' ? [ - // Since we do not use moment's locale feature, we exclude them from the bundle. - // This reduces the bundle size by 0.4MB. - new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/), - new webpack.DefinePlugin({ - 'process.env': { - 'NODE_ENV': JSON.stringify(process.env.NODE_ENV) - } - }), - new webpack.optimize.UglifyJsPlugin({ - mangle: { - except: ['BigNumber'] - } - }) - ] : [], + plugins: + process.env.NODE_ENV === 'production' + ? [ + // Since we do not use moment's locale feature, we exclude them from the bundle. + // This reduces the bundle size by 0.4MB. + new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/), + new webpack.DefinePlugin({ + 'process.env': { + NODE_ENV: JSON.stringify(process.env.NODE_ENV), + }, + }), + new webpack.optimize.UglifyJsPlugin({ + mangle: { + except: ['BigNumber'], + }, + }), + ] + : [], }; |