aboutsummaryrefslogtreecommitdiffstats
path: root/packages/0x.js
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2018-10-05 01:30:54 +0800
committerGitHub <noreply@github.com>2018-10-05 01:30:54 +0800
commit2da7626b5356f7b0ec809719f1b9da14b2969a07 (patch)
tree4359f2994d2b3d0ec3f82098f9415fd010ea9a26 /packages/0x.js
parentf7917cfa659452981df8233248283ca760d870a1 (diff)
parent98db4b154343127bdecbbb1e72f8ef1bb49b494e (diff)
downloaddexon-sol-tools-2da7626b5356f7b0ec809719f1b9da14b2969a07.tar
dexon-sol-tools-2da7626b5356f7b0ec809719f1b9da14b2969a07.tar.gz
dexon-sol-tools-2da7626b5356f7b0ec809719f1b9da14b2969a07.tar.bz2
dexon-sol-tools-2da7626b5356f7b0ec809719f1b9da14b2969a07.tar.lz
dexon-sol-tools-2da7626b5356f7b0ec809719f1b9da14b2969a07.tar.xz
dexon-sol-tools-2da7626b5356f7b0ec809719f1b9da14b2969a07.tar.zst
dexon-sol-tools-2da7626b5356f7b0ec809719f1b9da14b2969a07.zip
Merge pull request #1115 from 0xProject/upgradeWebpack
Upgrade Webpack
Diffstat (limited to 'packages/0x.js')
-rw-r--r--packages/0x.js/package.json7
-rw-r--r--packages/0x.js/webpack.config.js31
2 files changed, 16 insertions, 22 deletions
diff --git a/packages/0x.js/package.json b/packages/0x.js/package.json
index c89a3e613..268972a4f 100644
--- a/packages/0x.js/package.json
+++ b/packages/0x.js/package.json
@@ -52,13 +52,12 @@
"@types/node": "*",
"@types/sinon": "^2.2.2",
"@types/web3-provider-engine": "^14.0.0",
- "awesome-typescript-loader": "^3.1.3",
+ "awesome-typescript-loader": "^5.2.1",
"chai": "^4.0.1",
"chai-as-promised": "^7.1.0",
"chai-bignumber": "^2.0.1",
"copyfiles": "^2.0.0",
"dirty-chai": "^2.0.1",
- "json-loader": "^0.5.4",
"make-promises-safe": "^1.1.0",
"mocha": "^4.1.0",
"npm-run-all": "^4.1.2",
@@ -70,8 +69,8 @@
"tslint": "5.11.0",
"typedoc": "0.12.0",
"typescript": "3.0.1",
- "uglifyjs-webpack-plugin": "^1.3.0",
- "webpack": "^3.1.0"
+ "uglifyjs-webpack-plugin": "^2.0.1",
+ "webpack": "^4.20.2"
},
"dependencies": {
"@0xproject/assert": "^1.0.12",
diff --git a/packages/0x.js/webpack.config.js b/packages/0x.js/webpack.config.js
index 1ad0a79ec..397faa76f 100644
--- a/packages/0x.js/webpack.config.js
+++ b/packages/0x.js/webpack.config.js
@@ -2,8 +2,7 @@
* This is to generate the umd bundle only
*/
const _ = require('lodash');
-const webpack = require('webpack');
-const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
+const TerserPlugin = require('terser-webpack-plugin');
const path = require('path');
const production = process.env.NODE_ENV === 'production';
@@ -16,6 +15,7 @@ if (production) {
module.exports = {
entry,
+ mode: 'production',
output: {
path: path.resolve(__dirname, '_bundles'),
filename: '[name].js',
@@ -27,19 +27,18 @@ module.exports = {
extensions: ['.ts', '.js', '.json'],
},
devtool: 'source-map',
- plugins: [
- // TODO: Revert to webpack bundled version with webpack v4.
- // The v3 series bundled version does not support ES6 and
- // fails to build.
- new UglifyJsPlugin({
- sourceMap: true,
- uglifyOptions: {
- mangle: {
- reserved: ['BigNumber'],
+ optimization: {
+ minimizer: [
+ new TerserPlugin({
+ sourceMap: true,
+ terserOptions: {
+ mangle: {
+ reserved: ['BigNumber'],
+ },
},
- },
- }),
- ],
+ }),
+ ],
+ },
module: {
rules: [
{
@@ -59,10 +58,6 @@ module.exports = {
],
exclude: /node_modules/,
},
- {
- test: /\.json$/,
- loader: 'json-loader',
- },
],
},
};