๐ generator-choo-webpack [](https://travis-ci.org/danneu/generator-choo-webpack) [](http://badge.fury.io/js/generator-choo-webpack) [](https://david-dm.org/danneu/generator-choo-webpack)
July 22, 2016 ยท View on GitHub
Create the minimal Choo + Babel + Webpack project boilerplate.
$ yo choo-webpack my-app
> do you want to use Twitter Bootstrap v3? (y/N)
Project generated!
$ cd my-app
$ npm start
Development server listening at <http://localhost:8080>
Features
- Optional Twitter Bootstrap (Sass) v3: You can opt-in during the generator prompt. Once you opt-in, you can immediately start using Bootstrap classes and it'll just work.
- Sass support:
Just write SASS in your
.scssfiles if you want it. - CSS vendor autoprefixing:
Automatically adds prefixes like
-webkitto your styles when necessary. - Babel plugins: es2040 +
{ ...spread }
Install
Install Yeoman (generator framework) and generator-choo-webpack globally:
$ npm install -g yo generator-choo-webpack
Generate
Generate scaffolding in a target folder:
$ yo choo-webpack <destinationFolder>
Or in the current folder:
$ yo choo-webpack .
Run
Development
Start the local development server and visit http://localhost:8080.
$ npm start
Production
Bundle the app into a dist folder ready to be deployed.
$ npm run build
.
โโโ dist
ย ย โโโ index.html
ย ย โโโ 5df766af1ced8ff1fe0a.css
ย ย โโโ 5df766af1ced8ff1fe0a.js
ย ย โโโ img
ย ย โโโ ...
To test the production build locally, spin up a static asset server to avoid broken links.
$ npm run build && npm run serve
server listening on http://localhost:8080
Anatomy of the Scaffolding
Here's the generated project folder:
.
โโโ README.md # for your personal use, notes
โโโ package.json # dependencies, implements the `npm` commands
โโโ src # your choo application code goes here
โย ย โโโ index.js # root choo component, begin hacking here
โโโ static # holds static assets (html, css, js, img, ...)
โย ย โโโ css
โย ย โย ย โโโ index.scss # root css file that should @import other css files
โย ย โย ย โโโ bootstrap # if you opted into bootstrap, can customize it here
โย ย โย ย ย ย โโโ pre-customizations.scss # tweak bootstrap $vars before it loads
โย ย โย ย ย ย โโโ customizations.scss # override bootstrap after it loads
โย ย โโโ favicon.ico # a default favicon for you to replace
โย ย โโโ index.html # root html file
โย ย โโโ index.js # root javascript file, webpack entrypoint
โโโ .bootstraprc # if you opted into bootstrap, you can configure it here
โโโ webpack.config.js
โโโ dist # the stand-alone folder generated by `npm run build`
โโโ index.html # throw the contents on a server and open index.html
โโโ <hash>.js
โโโ <hash>.css
โโโ ...
License
MIT ยฉ Dan Neumann