diff --git a/app/client/build.sh b/app/client/build.sh index c42a32a0c366..146c6d355f0c 100755 --- a/app/client/build.sh +++ b/app/client/build.sh @@ -18,6 +18,6 @@ export REACT_APP_SENTRY_RELEASE=$GIT_SHA export REACT_APP_CLIENT_LOG_LEVEL=ERROR # Disable CRA built-in ESLint checks since we have our own config and a separate step for this export DISABLE_ESLINT_PLUGIN=true -craco --max-old-space-size=10240 build --config craco.build.config.js +craco --max-old-space-size=7168 build --config craco.build.config.js echo "build finished" diff --git a/app/client/craco.build.config.js b/app/client/craco.build.config.js index 540c3ea3e438..574a6a5788ad 100644 --- a/app/client/craco.build.config.js +++ b/app/client/craco.build.config.js @@ -38,7 +38,7 @@ plugins.push( }), ); -if (env === "PRODUCTION" || env === "STAGING") { +if (env === "PRODUCTION") { plugins.push( new FaroSourceMapUploaderPlugin({ appId: process.env.REACT_APP_FARO_APP_ID, @@ -53,8 +53,6 @@ if (env === "PRODUCTION" || env === "STAGING") { ); } -plugins.push(new CompressionPlugin()); - plugins.push( new CompressionPlugin({ algorithm: "brotliCompress", @@ -78,17 +76,16 @@ plugins.push( ); module.exports = merge(common, { - webpack: { - configure: { - plugins, + babel: { + plugins: ["babel-plugin-lodash"], + loaderOptions: { + cacheDirectory: false, }, }, - jest: { + webpack: { configure: { - moduleNameMapper: { - // Jest module mapper which will detect our absolute imports. - "^@test(.*)$": "/test$1", - }, + devtool: env === "PRODUCTION" ? "source-map" : false, + plugins, }, }, plugins: [ diff --git a/app/client/craco.common.config.js b/app/client/craco.common.config.js index e1c4c6cf99b0..7840177ca5f8 100644 --- a/app/client/craco.common.config.js +++ b/app/client/craco.common.config.js @@ -4,19 +4,6 @@ const path = require("path"); const webpack = require("webpack"); module.exports = { - devServer: { - client: { - webSocketURL: { - hostname: "127.0.0.1", - pathname: "/ws", - port: 3000, - protocol: "ws", - }, - }, - }, - babel: { - plugins: ["babel-plugin-lodash"], - }, eslint: { enable: false, }, diff --git a/app/client/craco.dev.config.js b/app/client/craco.dev.config.js index 9834c2b38a36..8bf01639ff77 100644 --- a/app/client/craco.dev.config.js +++ b/app/client/craco.dev.config.js @@ -5,23 +5,31 @@ const common = require("./craco.common.config.js"); module.exports = merge(common, { devServer: { client: { + webSocketURL: { + hostname: "127.0.0.1", + pathname: "/ws", + port: 3000, + protocol: "ws", + }, overlay: { warnings: false, errors: false, }, }, }, - optimization: { - minimize: false, - }, - cache: { - type: "filesystem", - memoryCacheUnaffected: true, - }, - experiments: { - cacheUnaffected: true, - }, webpack: { + configure: { + optimization: { + minimize: false, + }, + cache: { + type: "filesystem", + memoryCacheUnaffected: true, + }, + experiments: { + cacheUnaffected: true, + }, + }, plugins: [ new WorkboxPlugin.InjectManifest({ swSrc: "./src/serviceWorker.ts",