Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/client/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
19 changes: 8 additions & 11 deletions app/client/craco.build.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -53,8 +53,6 @@ if (env === "PRODUCTION" || env === "STAGING") {
);
}

plugins.push(new CompressionPlugin());

plugins.push(
new CompressionPlugin({
algorithm: "brotliCompress",
Expand All @@ -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(.*)$": "<rootDir>/test$1",
},
devtool: env === "PRODUCTION" ? "source-map" : false,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@KelvinOm can you also change the condition for faros sourcemap plugin? It's enabled for STAGING and PRODUCTION now.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dvj1988 Do you mean to remove check for STAGING and leave it only PRODUCTION? I.e. the condition will be like this?

if (env === "PRODUCTION") {
  plugins.push(
    new FaroSourceMapUploaderPlugin({...}),
  );
}

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes.

plugins,
},
},
plugins: [
Expand Down
13 changes: 0 additions & 13 deletions app/client/craco.common.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
Expand Down
28 changes: 18 additions & 10 deletions app/client/craco.dev.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Loading