Skip to content
This repository has been archived by the owner on Apr 20, 2023. It is now read-only.

Commit

Permalink
reduce file sizes
Browse files Browse the repository at this point in the history
  • Loading branch information
samelamin committed Apr 6, 2023
1 parent d82221c commit abfc95a
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
5 changes: 4 additions & 1 deletion api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"scripts": {
"test": "jest",
"start": "NODE_ENV=development webpack watch --config ./src/frontend/webpack.config.js --mode development & NODE_ENV=development webpack watch --mode development & TS_NODE_PROJECT=./src/backend/tsconfig.json nodemon -L --watch src/backend --ext 'js,ts' --exec 'node --inspect=0.0.0.0:9229 --require ts-node/register src/backend/index.ts'",
"build/frontend": "webpack --mode=production --config ./src/frontend/webpack.config.js",
"build/frontend": "webpack --config ./src/frontend/webpack.config.js",
"build/backend": "tsc -p ./src/backend",
"watch/frontend": "NODE_ENV=development webpack watch --config ./src/frontend/webpack.config.js --mode development",
"watch/backend": "nodemon -L --watch src/backend --ext 'js,ts' src/backend/index.ts",
Expand Down Expand Up @@ -107,5 +107,8 @@
"webpack": "^5.77.0",
"webpack-bundle-analyzer": "^4.5.0",
"webpack-cli": "^4.10.0"
},
"browser": {
"[module-name]": false
}
}
14 changes: 13 additions & 1 deletion api/src/frontend/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const path = require("path");
var mode = process.env.NODE_ENV || 'development';

module.exports = {
entry: {
Expand All @@ -21,7 +22,7 @@ module.exports = {
},
devtool: process.env.NODE_ENV === "development"
? "inline-source-map"
: void 0,
: false,
module: {
rules: [
{
Expand Down Expand Up @@ -50,10 +51,21 @@ module.exports = {
},
resolve: {
extensions: [".ts", ".tsx", ".js", ".jsx"],
fallback: {
"crypto": require.resolve("crypto-browserify"),
"stream": require.resolve("stream-browserify"),
"buffer": false,
},
},
output: {
path: path.resolve(__dirname, "../../public/lib"),
},
mode: mode,
performance: {
hints: false,
maxEntrypointSize: 512000,
maxAssetSize: 512000
},
watchOptions: {
poll: true
},
Expand Down

0 comments on commit abfc95a

Please sign in to comment.