ralberth / quizshow

Run a Q&A game for friends on multiple computers/phones
Apache License 2.0
8 stars 2 forks source link

Webpack-ify the build? #3

Closed philcali closed 5 years ago

philcali commented 5 years ago

Curious if you are at all opposed to webpack-ing the build process. I think it would benefit with "player" and "admin" entry points, plus your get a lot of the hot loading stuff for free ( in addition to combining, transforming, compressing, etc).

ralberth commented 5 years ago

Webpack, et al are built into CRA!

% npm run build
...
> react-scripts build
...
Creating an optimized production build...
Compiled successfully.
...
% more build/static/js/
2.28e97a6c.chunk.js           main.2c75f18f.chunk.js        runtime~main.a8a9905a.js
2.28e97a6c.chunk.js.map       main.2c75f18f.chunk.js.map    runtime~main.a8a9905a.js.map

Here's what the dev server looks like via "Inspect Element" in FireFox:

Screen Shot 2019-08-18 at 11 35 49 AM

It's chunking and transpiling down to pure JavaScript already.

CreateReactApp for the win!

Also, awesome that you are tracking this build! Thanks for caring :-)

philcali commented 5 years ago

Ah, very nice! I was confused because of the lack of webpack configuration. Looks like it would be pretty trivial to break glass with your own overrides if you ever needed to. BTW, npm run build fails in the same way represented as issue #1. Am I missing some CRA bootstrapping in order to get successful compilation?