Skip to content

Commit 191c17e

Browse files
authored
fix(generate): Replace + with \x00 (#10)
BREAKING CHANGE: This change will result in new names being generated, particularly those using [hash]. You will need to upgrade to css-loader >= 4 if you are wanting to keep the classes in sync.
1 parent d57cb1c commit 191c17e

File tree

4 files changed

+30
-20
lines changed

4 files changed

+30
-20
lines changed

index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ module.exports = function createGenerator(pattern, options) {
3434
content:
3535
hashPrefix +
3636
path.relative(context, filepath).replace(/\\/g, "/") +
37-
"+" +
37+
"\x00" +
3838
localName,
3939
context: context
4040
};

package-lock.json

+25-15
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,6 @@
2626
"tape": "^4.6.2"
2727
},
2828
"dependencies": {
29-
"loader-utils": "^1.1.0"
29+
"loader-utils": "^2.0.0"
3030
}
3131
}

test/index.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ test("use `cwd` if no context was provided", t => {
1111

1212
t.equal(
1313
generate("foo", path.join(__dirname, "test/case/source.css")),
14-
"source__foo___3D34a"
14+
"source__foo___2e6d7"
1515
);
1616
t.end();
1717
});
@@ -23,7 +23,7 @@ test("generate distinct hash for the provided context", t => {
2323

2424
t.equal(
2525
generate("foo", path.join(__dirname, "test/case/source.css")),
26-
"source__foo___19xFw"
26+
"source__foo___22-0m"
2727
);
2828
t.end();
2929
});
@@ -36,7 +36,7 @@ test("generate distinct hash for the provided hashPrefix", t => {
3636

3737
t.equal(
3838
generate("foo", path.join(__dirname, "test/case/source.css")),
39-
"source__foo___3T0Un"
39+
"source__foo___1rt0M"
4040
);
4141
t.end();
4242
});

0 commit comments

Comments
 (0)