From d52c1310b28a574f9ef4fe558cfe1ef508a64d7c Mon Sep 17 00:00:00 2001 From: Brandon Millman Date: Thu, 23 Aug 2018 14:40:29 -0700 Subject: Update uglify plugin to support es6 --- packages/0x.js/webpack.config.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'packages/0x.js/webpack.config.js') diff --git a/packages/0x.js/webpack.config.js b/packages/0x.js/webpack.config.js index 2c1fe81a7..982e076ee 100644 --- a/packages/0x.js/webpack.config.js +++ b/packages/0x.js/webpack.config.js @@ -3,6 +3,7 @@ */ const _ = require('lodash'); const webpack = require('webpack'); +const UglifyJsPlugin = require('uglifyjs-webpack-plugin'); const path = require('path'); const production = process.env.NODE_ENV === 'production'; @@ -27,10 +28,16 @@ module.exports = { }, devtool: 'source-map', plugins: [ - new webpack.optimize.UglifyJsPlugin({ - minimize: true, + // 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, - include: /\.min\.js$/, + uglifyOptions: { + mangle: { + reserved: ['BigNumber'], + }, + }, }), ], module: { -- cgit v1.2.3 From e7d5ceb9c5487a5851dbfc1f8bdbe0182fedaef2 Mon Sep 17 00:00:00 2001 From: Alex Browne Date: Wed, 29 Aug 2018 11:15:30 -0700 Subject: feat: Add support for TypeScript project references (#991) * Update all package.json and tsconfig.json * fix(contracts): Make test/utils/web3_wrapper.ts compatible with project refs * Fix webpack config for 0x.js * Fix linter errors by adding rootDir to tsconfig.json as needed * Add build:ts and watch:ts commands to package.json * Update sra-spec to work with project references * Update tsconfig.json with latest new/removed packages * Add TypeScript as devDependency at root * Add missing rootDir to forwarder-helper package * Use a separate tsconfig file for typedoc * Fix linter errors * Apply PR feedback (add comments) * Fix 0x.js tsconfig --- packages/0x.js/webpack.config.js | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'packages/0x.js/webpack.config.js') diff --git a/packages/0x.js/webpack.config.js b/packages/0x.js/webpack.config.js index 982e076ee..1ad0a79ec 100644 --- a/packages/0x.js/webpack.config.js +++ b/packages/0x.js/webpack.config.js @@ -47,8 +47,13 @@ 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, }, }, ], -- cgit v1.2.3 From c613b6741d7eff069c93ef1a800b67ddfb618c51 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Thu, 4 Oct 2018 15:47:43 +0100 Subject: Upgrade webpack --- packages/0x.js/webpack.config.js | 31 +++++++++++++------------------ 1 file changed, 13 insertions(+), 18 deletions(-) (limited to 'packages/0x.js/webpack.config.js') 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', - }, ], }, }; -- cgit v1.2.3