aboutsummaryrefslogtreecommitdiffstats
path: root/packages/website/webpack.config.js
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2018-03-14 23:37:09 +0800
committerFabio Berger <me@fabioberger.com>2018-03-14 23:37:09 +0800
commit56eeea1e633b3d0b41b50df6dcd8f76d284d5c73 (patch)
treed0405e6aa9244c555ee8f17f7bea275ddfcdea66 /packages/website/webpack.config.js
parent642a2cf165abe527bba015b3a923d9624d1b1a3d (diff)
downloaddexon-sol-tools-56eeea1e633b3d0b41b50df6dcd8f76d284d5c73.tar
dexon-sol-tools-56eeea1e633b3d0b41b50df6dcd8f76d284d5c73.tar.gz
dexon-sol-tools-56eeea1e633b3d0b41b50df6dcd8f76d284d5c73.tar.bz2
dexon-sol-tools-56eeea1e633b3d0b41b50df6dcd8f76d284d5c73.tar.lz
dexon-sol-tools-56eeea1e633b3d0b41b50df6dcd8f76d284d5c73.tar.xz
dexon-sol-tools-56eeea1e633b3d0b41b50df6dcd8f76d284d5c73.tar.zst
dexon-sol-tools-56eeea1e633b3d0b41b50df6dcd8f76d284d5c73.zip
Add fix to webpack for issue: https://github.com/trufflesuite/ganache-core/issues/84 and prettier the configs
Diffstat (limited to 'packages/website/webpack.config.js')
-rw-r--r--packages/website/webpack.config.js48
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'],
+ },
+ }),
+ ]
+ : [],
};