aboutsummaryrefslogtreecommitdiffstats
path: root/packages/0x.js/webpack.config.js
diff options
context:
space:
mode:
authorBrandon Millman <brandon.millman@gmail.com>2018-10-05 07:06:05 +0800
committerBrandon Millman <brandon.millman@gmail.com>2018-10-05 07:06:05 +0800
commite5153737d8386380675f28dd7cda70deeb1ea37c (patch)
tree81b061d2fa1af5952acc5abb41003f043ff8fce1 /packages/0x.js/webpack.config.js
parent88766a02c7e6688e72d5c4c69ce68028b322f154 (diff)
parentb04b649ec044b05f5c37bec214b7f992feb5998e (diff)
downloaddexon-sol-tools-e5153737d8386380675f28dd7cda70deeb1ea37c.tar
dexon-sol-tools-e5153737d8386380675f28dd7cda70deeb1ea37c.tar.gz
dexon-sol-tools-e5153737d8386380675f28dd7cda70deeb1ea37c.tar.bz2
dexon-sol-tools-e5153737d8386380675f28dd7cda70deeb1ea37c.tar.lz
dexon-sol-tools-e5153737d8386380675f28dd7cda70deeb1ea37c.tar.xz
dexon-sol-tools-e5153737d8386380675f28dd7cda70deeb1ea37c.tar.zst
dexon-sol-tools-e5153737d8386380675f28dd7cda70deeb1ea37c.zip
Merge branch 'development'
* development: (939 commits) Add asset-buyer to published packages section in README Publish Updated CHANGELOGS Update BuyQuote interface force re-build Add website build to instructions Revert format and re-add changes Build website in parallel with other tests since no other test relies on it being built to run Add back sourceMap support for both dev/prod Upgrade webpack Add missing default options Remove unused constants Add fee order with a takerFee Add additional order factory methods and refactor test to use them Add comments about buy quote calculation Update CHANGELOG Fix linter Add additional test for slippage Add buy_quote_calculator_test Add 0x Instant to bundle analysis ...
Diffstat (limited to 'packages/0x.js/webpack.config.js')
-rw-r--r--packages/0x.js/webpack.config.js31
1 files changed, 19 insertions, 12 deletions
diff --git a/packages/0x.js/webpack.config.js b/packages/0x.js/webpack.config.js
index 2c1fe81a7..397faa76f 100644
--- a/packages/0x.js/webpack.config.js
+++ b/packages/0x.js/webpack.config.js
@@ -2,7 +2,7 @@
* This is to generate the umd bundle only
*/
const _ = require('lodash');
-const webpack = require('webpack');
+const TerserPlugin = require('terser-webpack-plugin');
const path = require('path');
const production = process.env.NODE_ENV === 'production';
@@ -15,6 +15,7 @@ if (production) {
module.exports = {
entry,
+ mode: 'production',
output: {
path: path.resolve(__dirname, '_bundles'),
filename: '[name].js',
@@ -26,13 +27,18 @@ module.exports = {
extensions: ['.ts', '.js', '.json'],
},
devtool: 'source-map',
- plugins: [
- new webpack.optimize.UglifyJsPlugin({
- minimize: true,
- sourceMap: true,
- include: /\.min\.js$/,
- }),
- ],
+ optimization: {
+ minimizer: [
+ new TerserPlugin({
+ sourceMap: true,
+ terserOptions: {
+ mangle: {
+ reserved: ['BigNumber'],
+ },
+ },
+ }),
+ ],
+ },
module: {
rules: [
{
@@ -40,17 +46,18 @@ module.exports = {
use: [
{
loader: 'awesome-typescript-loader',
+ // tsconfig.json contains some options required for
+ // project references which do not work with webback.
+ // We override those options here.
query: {
declaration: false,
+ declarationMap: false,
+ composite: false,
},
},
],
exclude: /node_modules/,
},
- {
- test: /\.json$/,
- loader: 'json-loader',
- },
],
},
};