项目作者: wochap

项目描述 :
高级语言: JavaScript
项目地址: git://github.com/wochap/freeCodeCamp-Build-a-Simon-Game.git
创建时间: 2017-02-13T14:57:48Z
项目社区:https://github.com/wochap/freeCodeCamp-Build-a-Simon-Game

开源协议:

下载


Webpack boilerplate

A highly scalable and simple webpack boilerplate for client apps.

Quick start

Rename .env.example to .env. Then:

  1. # install dependencies
  2. $ yarn
  3. # serve with hot reload
  4. $ yarn build:watch
  5. # build for production with minification
  6. $ yarn build
  7. # run tests
  8. $ yarn test
  9. # run tests and watch
  10. $ yarn test:watch
  11. # run test coverage report
  12. $ yarn test:coverage

NOTE: For disable sourceMap, just remove it from .env file.

Documentation

Features

  • HMR
  • CSS < PostCSS < SCSS
  • JS < ES2015 < ESLint
  • Browser Sync
  • Images and fonts well configured.
  • Long term caching.
  • Tree shaking.
  • Tests with Jest.

Boilerplate structure

  1. .
  2. ├── .babelrc # babel config
  3. ├── .editorconfig # editor config
  4. ├── .env.example # env variables example
  5. ├── .eslintignore # eslint ignore config
  6. ├── .eslintrc # eslint config
  7. ├── .gitignore # git ignore config
  8. ├── .nvmrc # nvm config
  9. ├── .tern-project # atom-ternjs project config
  10. ├── package.json # https://docs.npmjs.com/files/package.json
  11. ├── postcss.config.js # postcss config
  12. ├── README.md # this file
  13. ├── webpack.config.js # webpack config
  14. ├── yarn.lock # https://yarnpkg.com/en/docs/yarn-lock
  15. ├── coverage/ # jest coverage output
  16. ├── dist/ # webpack build output
  17. ├── test/ # jest config
  18. ├── lib/ # future external packages
  19. ├── public/ # files that will be copied to dist
  20. └── src/ # source code
  21. ├── app/
  22. └── main.js # app entry file
  23. ├── styles/
  24. └── main.scss # main scss file
  25. └── index.html # template used by html-webpack-plugin

Troubleshooting

  • Module build failed: Error: ENOENT: no such file or directory, scandir

Rebuild node-sass

  1. $ npm rebuild node-sass

TODO

  • Refresh on each html-webpack-plugin template change.
  • Ignore webpack modules (e.g.: buffer, style-loader, etc) in production build.
  • Remove extra logs on production build.