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

Migrate from Webpack to Vite #879

Closed
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
1abf1d6
fix: Default-import Moment to make Vite happy
hyperupcall May 19, 2023
05c7673
fix: Export Redux store from a separate file
hyperupcall May 19, 2023
fd64495
fix: Use static plotly.js imports to make Vite happy
hyperupcall May 19, 2023
86c1ad1
feat: Remove Webpack and add Vite
hyperupcall May 19, 2023
f9d328c
chore: Add YAML to `.editorconfig`
hyperupcall May 19, 2023
e35768e
chore: Convert to tabs in `package{,-lock}.json` and config
hyperupcall May 19, 2023
a4e0244
chore: Format files
hyperupcall May 19, 2023
a9226d5
chore: Add previous formatting commit to new file `.git-blame-ignore-…
hyperupcall May 19, 2023
b16d091
chore: Update dependencies
hyperupcall May 19, 2023
1343091
fix: Miscellaneous fixes
hyperupcall May 19, 2023
5ce9935
fix: `peerDependency` resolutions
hyperupcall May 19, 2023
758d915
fix: Remove `core-js@2`
hyperupcall May 19, 2023
72efd58
fix: Make `TimeInterval.mjs` work
hyperupcall May 19, 2023
cde54ed
Various fixes and updates
hyperupcall May 19, 2023
f1f1457
fix: Expected a class/function as component Error
hyperupcall May 19, 2023
6a16512
fix: Import lodash with default imported
hyperupcall May 19, 2023
d0375a3
fix: Manually chunk dependencies for improved load times
hyperupcall May 19, 2023
547113e
chore: Update to Vite 4.3
hyperupcall May 19, 2023
413d58e
chore: Add missing license headers
hyperupcall May 19, 2023
78ed31e
Fix TypeScript error from `@formatjs/ecma402-abstract`
hyperupcall May 19, 2023
9455185
fix: Convert `TimeInterval.js` back to CommonJS
hyperupcall May 19, 2023
eb0f709
fix: Vite now listens on port `9229` in container
hyperupcall May 19, 2023
e38e99b
Merge branch 'development' into improve-build
hyperupcall Oct 16, 2023
3340c9b
fix: Remove vestiges
hyperupcall Oct 16, 2023
a4816a1
fix: Override transitive dependency resolutions
hyperupcall Oct 16, 2023
984ebd1
Fix typecheck and remove unused HTML file
hyperupcall Oct 16, 2023
6476534
fix: Do not race on `npm ci` in `docker-compose`
hyperupcall Oct 17, 2023
4773564
chore: Fix editorconfig
hyperupcall Oct 17, 2023
db186a3
Remove more Webpack things
hyperupcall Oct 22, 2023
347b1a4
Comment tweaks
hyperupcall Oct 30, 2023
8164663
Merge branch 'development' into improve-build
hyperupcall Oct 30, 2023
ef241f6
Set default for Vite dev server to `8085`
hyperupcall Oct 31, 2023
37e5aa6
style(webpack): Format code
hyperupcall Dec 4, 2023
32e497f
Merge branch 'development' into improve-build
hyperupcall Dec 4, 2023
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
17 changes: 7 additions & 10 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,26 +59,23 @@ services:
# Using a volume allows autorebuild to work.
volumes:
- ./:/usr/src/app
# Map the default port.
# List ports the container should expose
# For production you might want to add "80:3000" in place of the "3000:3000" line below
ports:
- "3000:3000" # Should be commented out if you uncomment 80:3000 below.
- "9229:9229" # Debug port, should be commented out for production
# For production you might want something like:
# - "80:3000"
# and comment out the debug port and 3000:3000 line above
# Don't bring this up without the DB
- "3000:3000"
- "9229:9229" # Development port; should be commented out for production
- "9230:9230"
Copy link
Contributor Author

@hyperupcall hyperupcall May 19, 2023

Choose a reason for hiding this comment

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

This is one of the issues that I'll mention in my update comment: In Docker, Vite does not listen on port 9229 because it is "already in use" - so as a fallback it listens on the port above that - 9230. As a workaround, expose port 9230 so things work.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This issue has been fixed in eb0f709


depends_on:
# Don't bring this up without the DB
- database
# database:
# We need the database and it has to be ready for work (see healthcheck above).
# condition: service_healthy
# Lets docker-compose up work right
# If environment variable install_args is not set then it becomes blank without warning user.
command:
[
"bash",
"./src/scripts/installOED.sh",
"${install_args:-}"
]
# Use this if you are using a docker-compose that is earlier than version 2 and comment out the one above.
# command: ["bash", "./src/scripts/installOED.sh"]
181 changes: 92 additions & 89 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 2 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
"scripts": {
"start": "node ./src/bin/www",
"start:dev": "nodemon --legacy-watch --inspect=0.0.0.0 ./src/bin/www",
"vite:dev": "vite --config ./src/vite.config.js build",
"vite:build": "vite --config",
"client:dev": "vite --config ./src/vite.config.js",
"client:build": "vite --config ./src/vite.config.js build",
"check": "./src/scripts/devcheck.sh",
"check:header": "./src/scripts/checkHeader.sh",
"check:typescript": "./src/scripts/checkTypescript.sh",
Expand Down Expand Up @@ -114,11 +114,8 @@
"devDependencies": {
"@redux-devtools/core": "~3.11.0",
"@redux-devtools/extension": "~3.2.2",
"@types/core-js": "~0.9.43",
"@types/express-rate-limit": "~6.0.0",
"@types/history": "~4.7.2",
"@types/lodash": "~4.14.122",
"@types/moment": "~2.13.0",
"@types/plotly.js": "~2.12.5",
"@types/rc-slider": "~8.2.3",
"@types/react": "~17.0.53",
Expand Down
2 changes: 2 additions & 0 deletions src/scripts/devstart.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
# * file, You can obtain one at http://mozilla.org/MPL/2.0/.
# *

# If we're in a container, pass '--host' flag so server remains
# accessible outside the container.
extra_args=
if [ -f /.dockerenv ]; then
# This is passed to vite, which exposts the port to the
Expand Down
3 changes: 0 additions & 3 deletions src/vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ export default defineConfig({
root: './src',
build: {
outDir: './server/public',
commonjsOptions: {
// exclude: [/TimeInterval.js$/],
},
},
publicDir: './client/public',
plugins: [react(), commonjs()],
Expand Down