From b507625d8a8f23c54eef8f78a7bd6c626ebdb15e Mon Sep 17 00:00:00 2001 From: Ray Millward Date: Wed, 12 Sep 2018 08:41:05 +0100 Subject: [PATCH] Removed source maps from the e2e tests, also updated to a parallel version of uglifyJS --- config-overrides.js | 4 ++ package-lock.json | 96 ++++++++++++++++++++++++++++++++++++++++++--- package.json | 3 +- 3 files changed, 97 insertions(+), 6 deletions(-) diff --git a/config-overrides.js b/config-overrides.js index 030cc956..70d18984 100644 --- a/config-overrides.js +++ b/config-overrides.js @@ -1,7 +1,11 @@ +const rewireUglifyjs = require('react-app-rewire-uglifyjs'); + module.exports = function override(config, env) { config.module.rules.push({ test: /\.worker\.js$/, use: { loader: 'worker-loader' } }) + + config = rewireUglifyjs(config); return config; } \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 364ac940..2c404b57 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1931,7 +1931,7 @@ "dependencies": { "acorn": { "version": "3.3.0", - "resolved": "http://registry.npmjs.org/acorn/-/acorn-3.3.0.tgz", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-3.3.0.tgz", "integrity": "sha1-ReN/s56No/JbruP/U2niu18iAXo=" } } @@ -2838,7 +2838,7 @@ }, "babel-plugin-istanbul": { "version": "4.1.6", - "resolved": "http://registry.npmjs.org/babel-plugin-istanbul/-/babel-plugin-istanbul-4.1.6.tgz", + "resolved": "https://registry.npmjs.org/babel-plugin-istanbul/-/babel-plugin-istanbul-4.1.6.tgz", "integrity": "sha512-PWP9FQ1AhZhS01T/4qLSKoHGY/xvkZdVBGlKM/HuxxS3+sC66HhTNR7+MpbO/so/cz/wY94MeSWJuP1hXIPfwQ==", "requires": { "babel-plugin-syntax-object-rest-spread": "^6.13.0", @@ -14491,7 +14491,7 @@ "dependencies": { "minimist": { "version": "1.2.0", - "resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=" } } @@ -18131,6 +18131,92 @@ "object-assign": "^4.1.0" } }, + "react-app-rewire-uglifyjs": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/react-app-rewire-uglifyjs/-/react-app-rewire-uglifyjs-0.1.1.tgz", + "integrity": "sha1-w9cqHsHQabFIIKWVFa1SYPU+W/8=", + "dev": true, + "requires": { + "uglifyjs-webpack-plugin": "^1.2.5" + }, + "dependencies": { + "ajv": { + "version": "6.5.3", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.5.3.tgz", + "integrity": "sha512-LqZ9wY+fx3UMiiPd741yB2pj3hhil+hQc8taf4o2QGRFpWgZ2V5C8HA165DY9sS3fJwsk7uT7ZlFEyC3Ig3lLg==", + "dev": true, + "requires": { + "fast-deep-equal": "^2.0.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + }, + "commander": { + "version": "2.13.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.13.0.tgz", + "integrity": "sha512-MVuS359B+YzaWqjCL/c+22gfryv+mCBPHAv3zyVI2GN8EY6IRP8VwtasXn8jyyhvvq84R4ImN1OKRtcbIasjYA==", + "dev": true + }, + "fast-deep-equal": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz", + "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=", + "dev": true + }, + "json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + }, + "schema-utils": { + "version": "0.4.7", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-0.4.7.tgz", + "integrity": "sha512-v/iwU6wvwGK8HbU9yi3/nhGzP0yGSuhQMzL6ySiec1FSrZZDkhm4noOSWzrNFo/jEc+SJY6jRTwuwbSXJPDUnQ==", + "dev": true, + "requires": { + "ajv": "^6.1.0", + "ajv-keywords": "^3.1.0" + } + }, + "uglify-es": { + "version": "3.3.9", + "resolved": "https://registry.npmjs.org/uglify-es/-/uglify-es-3.3.9.tgz", + "integrity": "sha512-r+MU0rfv4L/0eeW3xZrd16t4NZfK8Ld4SWVglYBb7ez5uXFWHuVRs6xCTrf1yirs9a4j4Y27nn7SRfO6v67XsQ==", + "dev": true, + "requires": { + "commander": "~2.13.0", + "source-map": "~0.6.1" + } + }, + "uglifyjs-webpack-plugin": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/uglifyjs-webpack-plugin/-/uglifyjs-webpack-plugin-1.3.0.tgz", + "integrity": "sha512-ovHIch0AMlxjD/97j9AYovZxG5wnHOPkL7T1GKochBADp/Zwc44pEWNqpKl1Loupp1WhFg7SlYmHZRUfdAacgw==", + "dev": true, + "requires": { + "cacache": "^10.0.4", + "find-cache-dir": "^1.0.0", + "schema-utils": "^0.4.5", + "serialize-javascript": "^1.4.0", + "source-map": "^0.6.1", + "uglify-es": "^3.3.4", + "webpack-sources": "^1.1.0", + "worker-farm": "^1.5.2" + } + }, + "uri-js": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", + "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", + "dev": true, + "requires": { + "punycode": "^2.1.0" + } + } + } + }, "react-app-rewired": { "version": "1.5.2", "resolved": "https://registry.npmjs.org/react-app-rewired/-/react-app-rewired-1.5.2.tgz", @@ -19864,7 +19950,7 @@ }, "minimist": { "version": "1.2.0", - "resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=" } } @@ -23475,7 +23561,7 @@ }, "jsonfile": { "version": "2.4.0", - "resolved": "http://registry.npmjs.org/jsonfile/-/jsonfile-2.4.0.tgz", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-2.4.0.tgz", "integrity": "sha1-NzaitCi4e72gzIO1P6PWM6NcKug=", "requires": { "graceful-fs": "^4.1.6" diff --git a/package.json b/package.json index 32bd3f37..22fec749 100644 --- a/package.json +++ b/package.json @@ -74,7 +74,7 @@ "server:dev": "nodemon ./server/test-malcolm-server.js", "start": "npm run config:dev && concurrently \"npm run server:dev\" \"react-app-rewired start\"", "ui-only": "npm run config:dev && react-app-rewired start", - "build:e2e": "npm run config:dev && cross-env REACT_APP_E2E=true react-app-rewired build", + "build:e2e": "npm run config:dev && cross-env GENERATE_SOURCEMAP=false REACT_APP_E2E=true react-app-rewired build", "build": "react-app-rewired build && npm run config:prod", "test": "react-app-rewired test --env=jsdom --coverage", "test:watch": "react-app-rewired test --env=jsdom --watch", @@ -118,6 +118,7 @@ "nodemon": "^1.17.4", "prettier": "^1.12.1", "q-i": "^2.0.1", + "react-app-rewire-uglifyjs": "^0.1.1", "react-app-rewired": "^1.5.2", "react-test-renderer": "^16.3.2", "source-map-explorer": "^1.6.0",