a simple boilerplate to bootstrap a server+client project
In short, Webpack Fatique. While webpack is supremely configurable, it's something of a nightmare to setup, and many basic assumptions (like babel support, jsx if using ReactJS, images, less/sass compiling, etc) are not included by default. Each has to be researched, included, and configured. If you want to build a server+client in a single app, this complexity explodes even further. Parcel.js touts a blazing fast "zero-config" setup, and has been confirmed by this project to do just that, while supporting many of these complexities out of the box.
/client
- throw your entire untranspiled client code+assets in here (entry point is index.html)/server
- throw your entire untranspiled server code here (entry point is index.js)/dist
- generated output using thenpm run build
ornpm run dev
commands.env
(root) - local environment variables will be automatically loadedrollup.config.js
- in case you have specific server-side build complexities, modify this
- React/JSX
- Hot Reloading
- CSS/LESS/SASS
- Images
- Autoreloading of server & client while in
npm run dev
mode - Sourcemaps (manual refresh required, as hot-reloading messes with sourcemaps)
- Build to ES5
- Cache-busting
The following NPM commands are included for convenience.
npm run dev # runs client and server in watch mode @ http://localhost:3000
npm run build # builds the server + client in production mode to /dist
npm start # runs the built server from /dist/server.js (sourced from /server/index.js)
# shortcuts
npm run build:start # builds and runs start