mirror of
https://github.com/wassname/react-webpack-template.git
synced 2026-08-12 12:20:13 +08:00
Added support for coverage reporting (as requested in https://github.com/newtriks/generator-react-webpack/issues/158)
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
# Welcome to react-webpack-template
|
||||
> This repository holds a base template for the new version of generator-react-webpack.
|
||||
It can be understood as the prototype for newly generated projects.
|
||||
> This repository holds the base template for the current version of [generator-react-webpack](https://github.com/newtriks/generator-react-webpack).
|
||||
It can also be used as the prototype for newly generated projects.
|
||||
|
||||
[](https://travis-ci.org/weblogixx/react-webpack-template)   
|
||||
|
||||
@@ -10,9 +10,10 @@ The following features are currently included:
|
||||
- [x] Webpack and Webpack-Dev-Server, including hot-loader
|
||||
- [x] Babel and JSX
|
||||
- [x] Mocha Unit tests (*optional*)
|
||||
- [x] EsLint Support
|
||||
- [x] esLint Support
|
||||
- [x] No dependency on grunt, gulp or the next hot taskrunner!
|
||||
- [x] Support for environment-specific configuration files
|
||||
- [x] Support for code coverage via [isparta-loader](https://github.com/deepsweet/isparta-loader)
|
||||
|
||||
## Todo
|
||||
- [ ] Better performance for webpack builds
|
||||
@@ -64,6 +65,30 @@ webpack-dev-server --env=dev
|
||||
webpack --env=dist
|
||||
webpack-dev-server --env=dist
|
||||
```
|
||||
## A note on unit testing
|
||||
When running tests, coverage information (provided via Istanbul) will also be written into the ```coverage/``` directory. If you do not need this, just comment out or remove the section in ```karma.conf``` like this:
|
||||
|
||||
```javascript
|
||||
/* do not use coverage reporting!
|
||||
coverageReporter: {
|
||||
type: 'html',
|
||||
dir: 'coverage/'
|
||||
}*/
|
||||
```
|
||||
|
||||
Also, you should adjust your webpack test configuration (located in ```cfg/test.js```) to reflect this:
|
||||
|
||||
```javascript
|
||||
/* Uncomment this to prevent loading via isparta
|
||||
{
|
||||
test: /\.(js|jsx)$/,
|
||||
loader: 'babel-loader',
|
||||
include: [
|
||||
path.join(__dirname, '/../src')
|
||||
],
|
||||
loader: 'isparta'
|
||||
}*/
|
||||
```
|
||||
|
||||
## License
|
||||
react-webpack-template is available under MIT-License and can therefore be used in any project free of charge.
|
||||
|
||||
Reference in New Issue
Block a user