Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simpler Webpack 5 config #637

Merged
merged 20 commits into from
Nov 30, 2023
Merged

Simpler Webpack 5 config #637

merged 20 commits into from
Nov 30, 2023

Conversation

fjsj
Copy link
Member

@fjsj fjsj commented Nov 28, 2023

Please merge first #636

args: [--fix]
# Run the formatter.
- id: ruff-format
- repo: https://github.com/pre-commit/mirrors-eslint
Copy link
Member Author

Choose a reason for hiding this comment

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

Use public eslint.

],
"@babel/preset-react"
]
}
Copy link
Member Author

Choose a reason for hiding this comment

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

Using this now instead of babel.config.js. Also, order matters here!

@@ -6,81 +6,77 @@
"engines": {
"node": ">=18 <21"
},
"main": "index.js",
"prettier": "eslint-config-vinta/prettier",
"browserslist": "> 0.25%, not dead",
Copy link
Member Author

Choose a reason for hiding this comment

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

I guess we didn't use that before and were generating larger bundles unnecessarily.

package.json Show resolved Hide resolved
"scripts": {
"test": "jest",
"test:watch": "npm test -- --watch",
"test:update": "npm test -- --u",
"start": "babel-node server.js",
"build": "NODE_ENV=production webpack --progress --config webpack.prod.config.js --bail",
"start": "webpack serve --mode=development --hot",
Copy link
Member Author

Choose a reason for hiding this comment

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

Avoid the custom server.js file.

"start": "babel-node server.js",
"build": "NODE_ENV=production webpack --progress --config webpack.prod.config.js --bail",
"start": "webpack serve --mode=development --hot",
"build": "NODE_ENV=production webpack --progress --bail --mode=production",
"lint": "eslint frontend --fix",
"coverage": "jest --coverage"
},
"dependencies": {
Copy link
Member Author

Choose a reason for hiding this comment

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

I upgraded ALL libraries.

@@ -0,0 +1,113 @@
const path = require("path");
Copy link
Member Author

Choose a reason for hiding this comment

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

Please review this whole file. I simplified it greatly.

@fjsj fjsj mentioned this pull request Nov 28, 2023
Base automatically changed from simplify-frontend to main November 30, 2023 12:45
@fjsj fjsj merged commit 03ede3f into main Nov 30, 2023
2 checks passed
@fjsj fjsj deleted the new-webpack-config branch November 30, 2023 12:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants