diff options
author | Brandon Millman <brandon@0xproject.com> | 2018-12-15 06:42:55 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-12-15 06:42:55 +0800 |
commit | e3dcb7107bdd7bd8197818a05b163985026f7ca2 (patch) | |
tree | ee8e5617762c49ab9bdb6bde676f49c91eb2f012 /packages/website/webpack.config.js | |
parent | 6d45beccad44e86ddd692d0cf54c09c29c5d9daf (diff) | |
parent | f7ceb4cf582debf2521ef4797674e31a86ff6a38 (diff) | |
download | dexon-sol-tools-e3dcb7107bdd7bd8197818a05b163985026f7ca2.tar dexon-sol-tools-e3dcb7107bdd7bd8197818a05b163985026f7ca2.tar.gz dexon-sol-tools-e3dcb7107bdd7bd8197818a05b163985026f7ca2.tar.bz2 dexon-sol-tools-e3dcb7107bdd7bd8197818a05b163985026f7ca2.tar.lz dexon-sol-tools-e3dcb7107bdd7bd8197818a05b163985026f7ca2.tar.xz dexon-sol-tools-e3dcb7107bdd7bd8197818a05b163985026f7ca2.tar.zst dexon-sol-tools-e3dcb7107bdd7bd8197818a05b163985026f7ca2.zip |
Merge pull request #1375 from bakkenbaeck/website
[WIP] Website
Diffstat (limited to 'packages/website/webpack.config.js')
-rw-r--r-- | packages/website/webpack.config.js | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/packages/website/webpack.config.js b/packages/website/webpack.config.js index 33d5f648b..aaaa31082 100644 --- a/packages/website/webpack.config.js +++ b/packages/website/webpack.config.js @@ -3,6 +3,7 @@ const webpack = require('webpack'); const TerserPlugin = require('terser-webpack-plugin'); const RollbarSourceMapPlugin = require('rollbar-sourcemap-webpack-plugin'); const childProcess = require('child_process'); +const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin; const GIT_SHA = childProcess .execSync('git rev-parse HEAD') @@ -55,6 +56,21 @@ const config = { test: /\.css$/, loaders: ['style-loader', 'css-loader'], }, + { + test: /\.svg$/, + use: [ + { + loader: "react-svg-loader", + options: { + svgo: { + plugins: [ + { removeViewBox: false } + ], + } + } + } + ] + }, ], }, optimization: { @@ -70,6 +86,7 @@ const config = { ], }, devServer: { + host: '0.0.0.0', port: 3572, historyApiFallback: { // Fixes issue where having dots in URL path that aren't part of fileNames causes webpack-dev-server @@ -85,6 +102,13 @@ const config = { ], }, disableHostCheck: true, + // Fixes assertion error + // Source: https://github.com/webpack/webpack-dev-server/issues/1491 + https: { + spdy: { + protocols: ['http/1.1'] + } + }, }, }; @@ -92,6 +116,9 @@ module.exports = (_env, argv) => { let plugins = []; if (argv.mode === 'development') { config.mode = 'development'; + plugins.concat([ + new BundleAnalyzerPlugin(), + ]); } else { config.mode = 'production'; plugins = plugins.concat([ |