3 ms·
Honestly I'd ditch CRA and hit up Vite nowadays. You will have to deal with a few poorly made packages (e.g. from Amazon) but it is a breath of fresh air.
by antihero 5y ago
Honestly I'd ditch CRA and hit up Vite nowadays. You will have to deal with a few poorly made packages (e.g. from Amazon) but it is a breath of fresh air.
- dimgl 5y ago+1, Vite is incredible
- iCarrot 5y agoI'm using Vite for a small greenfield project. Perhaps it's the selection of packages I use, but setting up was rather painful. Vite Vue + Typescript template run fine in dev mode but could not be built for production, thanks to a combination of an Vue issue and a tsconfig flag. Node polyfills work on `yarn dev`, but throw "kn.nextTick is not a function" for production build. Apparently I have to use package `rollup-plugin-polyfill-node` instead of `rollup-plugin-node-polyfills`. Now with all the setting up out of the way, it does feels good to have a dev server starting almost instantly, hot reload and full page reload stay constantly fast. Sometime though hot reload just fails and I had to manually reload the page, or manually remount the component I'm working on (by navigating back and forth) to see the changes. It also feels like I'm not even using typescript but plain javascript. Vite would happily serve broken code and some errors will only be shown on `yarn build`. I lost a watch compiler essentially.
- dimgl 5y agoI’ve had none of these issues. `tsc` should work for you out of the box. It also uses Rollup for bundling, so there is no reason you can’t build production packages with it.
- antihero 5y agoI wouldn’t really use my build/dev process to say my errors as they’re not parsed by vscode. I generally rely on either vscode inline type checking or a parsed tsc watch task that vscode generates automatically and helpfully displays the output of in my problems pane. Bundling and typechecking are different.
- Aeolun 5y agoUntil you get to testing, and c8, and you find that for some magic variation of ESM it’ll just count all lines as covered, regardless of whether there’s anything even on them (coverage for blank lines, yay).