Skip to content

Commit 5b77eff

Browse files
author
Rick
committed
Fixes RickWong#7 comma-separated rules.
1 parent 6ed94f1 commit 5b77eff

File tree

4 files changed

+16
-17
lines changed

4 files changed

+16
-17
lines changed

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "react-inline-css",
33
"description": "Inline CSS in your React components, namespaced automatically.",
4-
"version": "1.2.1",
4+
"version": "1.3.0",
55
"license": "BSD-3-Clause",
66
"repository": {
77
"type": "git",
@@ -26,12 +26,12 @@
2626
"react": ">= 0.12.0"
2727
},
2828
"devDependencies": {
29-
"babel-core": "5.8.22",
29+
"babel-core": "5.8.24",
3030
"babel-loader": "5.3.2",
3131
"concurrently": "0.1.1",
3232
"json-loader": "0.5.2",
33-
"react-hot-loader": "1.2.8",
34-
"webpack": "1.11.0",
33+
"react-hot-loader": "1.3.0",
34+
"webpack": "1.12.1",
3535
"webpack-dev-server": "1.10.1"
3636
}
3737
}

src/react-inline-css.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ var InlineCss = React.createClass({
2222
replace(/}\s*/ig, '\n}\n').
2323
// Regular rules are namespaced.
2424
replace(
25-
/(^|{|}|;|,)\s*([&a-z0-9\-_\.:#\(\),>*\s]+)\s*(\{)/ig,
26-
function (matched) {
27-
return matched.replace(componentName, "#" + namespace);
28-
}
29-
);
25+
/(^|{|}|;|,)\s*([&a-z0-9\-_\.:#\(\),>*\s]+)\s*(\{)/ig,
26+
function (matched) {
27+
return matched.replace(new RegExp(componentName, "g"), "#" + namespace);
28+
}
29+
);
3030
},
3131
render: function () {
3232
var componentName = this.props.componentName || "&";

webpack.client-watch.js

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
var webpack = require("webpack");
2-
var config = require("./webpack.client.js");
2+
var config = require("./webpack.client.js");
33

4-
config.cache = true;
5-
config.debug = true;
4+
config.cache = true;
5+
config.debug = true;
66
config.devtool = "eval";
77

88
config.entry.WDS = "webpack-dev-server/client?http://localhost:8080";
@@ -12,13 +12,12 @@ config.module.postLoaders = [
1212
{test: /\.js$/, loaders: ["react-hot"], exclude: /node_modules/}
1313
];
1414

15-
config.output.publicPath = "http://localhost:8080/dist/";
16-
config.output.hotUpdateMainFilename = "update/[hash]/update.json";
15+
config.output.publicPath = "http://localhost:8080/dist/";
16+
config.output.hotUpdateMainFilename = "update/[hash]/update.json";
1717
config.output.hotUpdateChunkFilename = "update/[hash]/[id].update.js";
1818

1919
config.plugins = [
20-
new webpack.HotModuleReplacementPlugin(),
21-
new webpack.NoErrorsPlugin()
20+
new webpack.HotModuleReplacementPlugin()
2221
];
2322

2423
config.devServer = {

webpack.client.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ module.exports = {
66
cache: false,
77
context: __dirname,
88
devtool: false,
9-
entry: ["./src/example"],
9+
entry: {example:"./src/example"},
1010
output: {
1111
path: path.join(__dirname, "static/dist"),
1212
filename: "[name].js",

0 commit comments

Comments
 (0)