Conversation
|
To run a dev server you can just enter Running The default server can be built using I did not touch the existing tsconfig as much as possible, but it could be further improved. Vite does not use tsc for building but rather uses esbuild, so the tsconfig for building the app has an explicit |
| "build:default": "webpack --config ./configs/webpack.config.js --mode production", | ||
| "watch:default": "webpack --config ./configs/webpack.config.js --mode development --watch --progress --color", | ||
| "build:default": "tsc -p ./configs/server.tsconfig.json && vite build", | ||
| "watch:default": "vite serve", |
There was a problem hiding this comment.
question (non-blocking): why did you changed this script to watch:default from dev?
Vite dev server does not generate any output, it acts as a middleware server that transforms whatever you ask for on the fly, thus it gets a bit confusing to me the wording watch since this has historically been used for tools like babel or webpack where we live transpile code and generate an output. I would argue to leave it as dev as it already is a widely adopted convention.
There was a problem hiding this comment.
I kept the previous script as is, dev:default would probably be more appropriate.
The suffix :default is still useful imho, as you need to distinguish between the component library and the app you are building.
|
any objection to merge that PR? That would make frontend development less painful. |
| <head> | ||
| <meta charset="UTF-8"> | ||
| <meta name="viewport" content="width=device-width, initial-scale=1"> | ||
| <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap" /> |
There was a problem hiding this comment.
Suggestion: You might want to consider handling fonts via a Vite plugin such as vite-plugin-webfont-dl.
Benefits:
- No third-party assets; fonts are downloaded from Google at build time
- Slight performance benefits
Alternatively, I'd consider setting a preconnect link.
| "scripts": { | ||
| "clean": "rimraf lib", | ||
| "build": "tsc -p ./tsconfig.json && tsc -p ./configs/server.tsconfig.json && yarn run lint", | ||
| "clean": "rimraf lib && rimraf dist", |
There was a problem hiding this comment.
There's an overlap with Vite's build.emptyOutDir option
This PR is intended to migrate the existing frontend build system to use vite.
Changes: