-
Notifications
You must be signed in to change notification settings - Fork 497
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
Conversation
.pre-commit-config.yaml
Outdated
args: [--fix] | ||
# Run the formatter. | ||
- id: ruff-format | ||
- repo: https://github.com/pre-commit/mirrors-eslint |
There was a problem hiding this comment.
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" | ||
] | ||
} |
There was a problem hiding this comment.
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", |
There was a problem hiding this comment.
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.
"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", |
There was a problem hiding this comment.
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": { |
There was a problem hiding this comment.
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"); |
There was a problem hiding this comment.
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.
Please merge first #636