Webpack + Coffeescript + Stylus + React boilerplate.
MIT License
Minimal, opinionated, from-scratch webpack boilerplate with:
Example adapted from http://gaearon.github.io/react-hot-loader/.
yarn
yarn start
(be sure to build first!)yarn dev
localhost:3000
, which proxies everything but/api
to webpack-dev-server
at localhost:8080
yarn analyze
webpack-bundle-analyzer
.yarn test
, yarn test:watch
, or yarn test:browser
yarn test:browser
will only pick up tests in app/
.dist/
: yarn build
The webpack configuration is generated based on npm_lifecycle_event
, so
running the scripts from package.json
directly will not yield the correct
results.
All files are in app/
unless otherwise noted.
require
, to allow tree-shaking.
require.context
for dynamic utils.$
helper from myutil
.main.coffee
, which also sets up hot reloading.Root.coffee
.components/
with the followingindex.coffee
: Exports a Redux-connected component.style.l.styl
: Locally scoped styles for the component.store.coffee
, and the root reducer atreducers/index.coffee
. The actions are bound to this store.reducers/
, and is automatically imported.actions/index.coffee
.actions/async.coffee
.reducers/
.
sqgl
app
tree ending with .spec.*
,*
is any extension (e.g. coffee
). These are all automaticallyyarn test
, yarn test:watch
, and yarn test:browser
.require
, not ES6 import/export, since node
doesn't support itgraphql/
.
schema/
.query/
.server/
.
index.coffee
, and it hooks up the API and the app.API/
.
index.coffee
here automatically creates an API based on therequire
s the corresponding.coffee
file in the API folder.server
tree ending with .spec.*
,*
is any extension (e.g. coffee
). These are all automaticallyyarn test
and yarn test:watch
, but not yarn test:browser
.