Skip to content

Commit a99519d

Browse files
committed
Added missing loaders to webpack default config, updated package lists
1 parent 399741b commit a99519d

File tree

5 files changed

+41
-15
lines changed

5 files changed

+41
-15
lines changed

.eslintrc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
"react/prefer-stateless-function": 0,
1212
"react/jsx-no-bind": 0,
1313
"strict": 0,
14-
"no-unused-expressions": 0
14+
"no-unused-expressions": 0,
15+
"no-underscore-dangle": [ "error", { "allowAfterThis": true }]
1516
}
1617
}

README.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,25 @@ You may use this template either directly (by cloning this git repository) or by
99
## Features
1010
The following features are currently included out of the box:
1111

12-
- [ ] Webpack 2 setup to get you started (including support for Hot-Loading, LESS/SASS/SCSS and PostCSS)
12+
- [x] Webpack 2 setup to get you started (including support for LESS/SASS/SCSS/Stylus and PostCSS)
1313
- [x] Babel 6 to transpile ES2015 and JSX
1414
- [x] React 15.0
1515
- [x] Mocha, Chai and Enzyme for easy unit testing (without karma)
16-
- [x] Isparta for collecting coverage information
16+
- [x] Istanbul and Isparta for collecting coverage information
1717
- [x] Preconfigured .editorconfig file
1818
- [x] Preconfigured eslint configuration, based on airbnb
1919

20+
## Common Questions:
21+
22+
- I want to use less/sass/whatever, but get an error when requiring the file:
23+
We currently do not ship the needed modules. This is done on purpose, as we dont want you to install too much dependencies. If you do not use a css precompiler, chance is you wont even notice it. If you need one, just install the required webpack loader (e.g. for less via ```npm install --save-dev less-loader```).
24+
25+
- I want to change/add/remove one of the given configs for webpack:
26+
The webpack configuration is located in ```conf/webpack```. All changes in Base.js will get delegated to all webpack configurations, so you will just have to update this file for adding loaders etc. You may add your own configurations at any time. Just make sure to extend ```WebpackBaseConfig``` to make it work. When ready, just update ```conf/webpack/index.js``` with your wanted options to make them work.
27+
28+
- Where do I find configuration options for *insert tool of choise here*:
29+
Every configuration options are located either directly in the project root (as for .babelrc, base webpack...) or as a folder in the conf directory.
30+
2031
## Using it
2132
The template uses webpack as build tool to serve files and run tests. The following commands are available:
2233

conf/webpack/Base.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,22 @@ class WebpackBaseConfig {
5151
test: /\.css$/,
5252
loaders: ['style', 'css']
5353
},
54+
{
55+
test: /\.sass$/,
56+
loaders: ['style', 'css', 'sass']
57+
},
58+
{
59+
test: /\.scss$/,
60+
loaders: ['style', 'css', 'sass']
61+
},
62+
{
63+
test: /\.less$/,
64+
loaders: ['style', 'css', 'less']
65+
},
66+
{
67+
test: /\.styl$/,
68+
loaders: ['style', 'css', 'stylus']
69+
},
5470
{
5571
test: /\.(png|jpg|gif|mp4|ogg|svg|woff|woff2)$/,
5672
loaders: ['file']

conf/webpack/Test.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
*/
44
'use strict';
55
const WebpackBaseConfig = require('./Base');
6-
const path = require('path');
76

87
class WebpackTestConfig extends WebpackBaseConfig {
98

@@ -22,10 +21,6 @@ class WebpackTestConfig extends WebpackBaseConfig {
2221
},
2322
{
2423
test: /\.(js|jsx)$/,
25-
/*include: [
26-
path.resolve('src'),
27-
path.resolve('test')
28-
],*/
2924
exclude: /(node_modules|bower_components)/,
3025
loader: 'babel',
3126
query: {

package.json

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
22
"name": "react-webpack-template",
33
"version": "2.0.0-alpha-1",
4-
"description": "Boilerplate Template for React and Webpack",
4+
"description": "React Webpack Starter Kit",
55
"main": "src/index.js",
66
"scripts": {
77
"start": "npm run serve:dev",
88
"test": "mocha",
9-
"test:watch": "npm test -- -w",
9+
"test:watch": "mocha -w",
1010
"cover": "babel-node ./node_modules/.bin/isparta cover ./node_modules/.bin/_mocha",
1111
"serve:dev": "webpack-dev-server --open --env dev",
1212
"dist": "webpack --progress --bail --env dist -p"
@@ -19,6 +19,9 @@
1919
"React",
2020
"Webpack",
2121
"Babel",
22+
"Starterkit",
23+
"Starter",
24+
"Template",
2225
"Boilerplate"
2326
],
2427
"author": "Christian Schilling ([email protected])",
@@ -31,20 +34,20 @@
3134
"babel-cli": "^6.7.7",
3235
"babel-core": "^6.7.6",
3336
"babel-loader": "^6.2.4",
34-
"babel-preset-airbnb": "^1.1.1",
37+
"babel-preset-airbnb": "^2.0.0",
3538
"babel-preset-es2015-native-modules": "^6.6.0",
3639
"babel-preset-react": "^6.5.0",
3740
"chai": "^3.5.0",
3841
"css-loader": "^0.23.1",
3942
"enzyme": "^2.2.0",
4043
"eslint": "^2.8.0",
41-
"eslint-config-airbnb": "^7.0.0",
44+
"eslint-config-airbnb": "^9.0.0",
4245
"eslint-plugin-import": "^1.4.0",
43-
"eslint-plugin-jsx-a11y": "^0.6.2",
44-
"eslint-plugin-react": "^4.3.0",
46+
"eslint-plugin-jsx-a11y": "^1.0.0",
47+
"eslint-plugin-react": "^5.0.0",
4548
"file-loader": "^0.8.5",
4649
"isparta": "^4.0.0",
47-
"jsdom": "^8.4.0",
50+
"jsdom": "^9.0.0",
4851
"mocha": "^2.4.5",
4952
"null-loader": "^0.1.1",
5053
"react-addons-test-utils": "^15.0.1",

0 commit comments

Comments
 (0)