Skip to content

Commit 357b8c8

Browse files
committed
Added support for regular css, as well as css modules (with own loader)
1 parent c65a790 commit 357b8c8

File tree

18 files changed

+25
-44
lines changed

18 files changed

+25
-44
lines changed

.babelrc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
22
"presets": [
33
"es2015-native-modules",
4-
"stage-0",
54
"react",
65
"airbnb"
76
],
87
"plugins": [
9-
"transform-decorators-legacy"
8+
"transform-decorators-legacy",
9+
"transform-object-rest-spread"
1010
]
1111
}

.eslintrc

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@
1010
"comma-dangle": 0,
1111
"padded-blocks": 0,
1212
"react/prefer-stateless-function": 0,
13-
"react/jsx-no-bind": 0,
14-
"strict": 0,
15-
"no-unused-expressions": 0,
1613
"no-underscore-dangle": [ "error", { "allowAfterThis": true }],
1714
"import/no-unresolved": [ "error", "ignore": [
1815
'config',

conf/webpack/Base.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
/**
22
* Webpack configuration base class
33
*/
4-
'use strict';
5-
64
const path = require('path');
75
const npmBase = path.join(__dirname, '../../node_modules');
86

@@ -69,7 +67,6 @@ class WebpackBaseConfig {
6967
*/
7068
get defaultSettings() {
7169
return {
72-
cache: true,
7370
context: this.srcPathAbsolute,
7471
debug: false,
7572
devtool: 'eval',
@@ -92,48 +89,51 @@ class WebpackBaseConfig {
9289
],
9390
loaders: [
9491
{
95-
test: /\.css$/,
92+
test: /\.cssmodule\.css$/,
9693
loaders: [
9794
'style',
9895
'css?modules&importLoaders=1&localIdentName=[name]-[local]-[hash:base64:5]'
9996
]
10097
},
10198
{
102-
test: /\.sass$/,
99+
test: /^.((?!cssmodule).)*\.css$/,
103100
loaders: [
104101
'style',
105-
'css?modules&importLoaders=1&localIdentName=[name]-[local]-[hash:base64:5]',
106-
'sass'
102+
'css'
107103
]
108104
},
109105
{
110-
test: /\.scss$/,
106+
test: /\.(sass|scss)$/,
111107
loaders: [
112108
'style',
113-
'css?modules&importLoaders=1&localIdentName=[name]-[local]-[hash:base64:5]',
109+
'css',
114110
'sass'
115111
]
116112
},
117113
{
118114
test: /\.less$/,
119115
loaders: [
120116
'style',
121-
'css?modules&importLoaders=1&localIdentName=[name]-[local]-[hash:base64:5]',
117+
'css',
122118
'less'
123119
]
124120
},
125121
{
126122
test: /\.styl$/,
127123
loaders: [
128124
'style',
129-
'css?modules&importLoaders=1&localIdentName=[name]-[local]-[hash:base64:5]',
125+
'css',
130126
'stylus'
131127
]
132128
},
133129
{
134130
test: /\.(png|jpg|gif|mp4|ogg|svg|woff|woff2)$/,
135131
loaders: ['file']
136132
},
133+
{
134+
test: /\.json$/,
135+
loaders: 'json'
136+
},
137137
{
138138
test: /\.(js|jsx)$/,
139139
include: [].concat(

conf/webpack/Dev.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
/**
22
* Default dev server configuration.
33
*/
4-
'use strict';
5-
64
const webpack = require('webpack');
75
const WebpackBaseConfig = require('./Base');
86

conf/webpack/Dist.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
* Dist configuration. Used to build the
33
* final output when running npm run dist.
44
*/
5-
'use strict';
6-
75
const webpack = require('webpack');
86
const WebpackBaseConfig = require('./Base');
97

conf/webpack/Test.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
/**
22
* Default test configuration.
33
*/
4-
'use strict';
54
const WebpackBaseConfig = require('./Base');
65
const webpack = require('webpack');
76

conf/webpack/index.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
'use strict';
21
const dev = require('./Dev');
32
const dist = require('./Dist');
43
const test = require('./Test');

karma.conf.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
'use strict';
21
const webpackCfg = require('./webpack.config')('test');
32

43
module.exports = function karmaConfig(config) {

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"posttest": "npm run lint",
1010
"test:watch": "karma start --autoWatch=true --singleRun=false --reporters=mocha,coverage",
1111
"serve:dev": "webpack-dev-server --open --env dev",
12-
"serve:dist": "webpack-dev-server --hot --inline --open --progress --env dist -p",
12+
"serve:dist": "webpack-dev-server --open --env dist -p --progress",
1313
"dist": "npm run clean && npm run copy && webpack --progress --bail --env dist -p",
1414
"lint": "eslint ./src",
1515
"clean": "rimraf dist/*",
@@ -42,11 +42,11 @@
4242
"babel-eslint": "^6.0.4",
4343
"babel-loader": "^6.2.4",
4444
"babel-plugin-transform-decorators-legacy": "^1.3.4",
45+
"babel-plugin-transform-object-rest-spread": "^6.8.0",
4546
"babel-polyfill": "^6.9.0",
4647
"babel-preset-airbnb": "^2.0.0",
4748
"babel-preset-es2015-native-modules": "^6.6.0",
4849
"babel-preset-react": "^6.5.0",
49-
"babel-preset-stage-0": "^6.5.0",
5050
"chai": "^3.5.0",
5151
"copyfiles": "^0.2.1",
5252
"css-loader": "^0.23.1",

src/components/App.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react';
22
import cssmodules from 'react-css-modules';
3-
import styles from './app.css';
3+
import styles from './app.cssmodule.css';
44

55
const yeomanImage = require('../images/yeoman.png');
66

0 commit comments

Comments
 (0)