We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e02e7a2 commit 7df51b3Copy full SHA for 7df51b3
lib/compile-exports.js
@@ -14,14 +14,23 @@ module.exports = function compileExports(result, importItemMatcher, camelCaseKey
14
var exportJs = Object.keys(result.exports).reduce(function(res, key) {
15
var valueAsString = JSON.stringify(result.exports[key]);
16
valueAsString = valueAsString.replace(result.importItemRegExpG, importItemMatcher);
17
- res.push("\t" + JSON.stringify(key) + ": " + valueAsString);
+ function addEntry(k) {
18
+ res.push("\t" + JSON.stringify(k) + ": " + valueAsString);
19
+ }
20
+ addEntry(key);
21
22
+ var targetKey;
23
if (camelCaseKeys === true) {
- res.push("\t" + JSON.stringify(camelCase(key)) + ": " + valueAsString);
24
+ targetKey = camelCase(key);
25
+ if (targetKey !== key) {
26
+ addEntry(targetKey);
27
28
} else if (camelCaseKeys === 'dashes') {
- res.push("\t" + JSON.stringify(dashesCamelCase(key)) + ": " + valueAsString);
29
+ targetKey = dashesCamelCase(key);
30
31
32
33
}
-
34
return res;
35
}, []).join(",\n");
36
package.json
@@ -1,6 +1,6 @@
1
{
2
"name": "css-loader",
3
- "version": "0.26.2",
+ "version": "0.26.3",
4
"author": "Tobias Koppers @sokra",
5
"description": "css loader module for webpack",
6
"engines": {
test/camelCaseTest.js
@@ -1,6 +1,7 @@
/*globals describe */
var test = require("./helpers").test;
+var testRaw = require("./helpers").testRaw;
describe("camelCase", function() {
7
var css = ".btn-info_is-disabled { color: blue; }";
@@ -21,4 +22,7 @@ describe("camelCase", function() {
test("with", css, exports.with, "?modules");
test("without", css, exports.without, "?modules&camelCase");
test("dashes", css, exports.dashes, "?modules&camelCase=dashes");
+
+ testRaw("withoutRaw", '.a {}', 'exports.locals = {\n\t"a": "_1buUQJccBRS2-2i27LCoDf"\n};', "?modules&camelCase");
+ testRaw("dashesRaw", '.a {}', 'exports.locals = {\n\t"a": "_1buUQJccBRS2-2i27LCoDf"\n};', "?modules&camelCase=dashes");
});
test/helpers.js
@@ -32,6 +32,10 @@ function assetEvaluated(output, result, modules) {
exports.should.be.eql(result);
+function assertRaw(output, result) {
+ output.should.containEql(result);
37
+}
38
39
function runLoader(loader, input, map, addOptions, callback) {
40
var opt = {
41
options: {
@@ -69,6 +73,18 @@ exports.test = function test(name, input, result, query, modules) {
69
73
70
74
};
71
75
76
+exports.testRaw = function testRaw(name, input, result, query, modules) {
77
+ it(name, function(done) {
78
+ runLoader(cssLoader, input, undefined, !query || typeof query === "string" ? {
79
+ query: query
80
+ } : query, function(err, output) {
81
+ if(err) return done(err);
82
+ assertRaw(output, result, modules);
83
+ done();
84
+ });
85
86
87
72
88
exports.testError = function test(name, input, onError) {
89
it(name, function(done) {
90
runLoader(cssLoader, input, undefined, {}, function(err, output) { // eslint-disable-line no-unused-vars
yarn.lock
@@ -165,14 +165,7 @@ [email protected]:
165
version "1.3.0"
166
resolved "https://registry.yarnpkg.com/browser-stdout/-/browser-stdout-1.3.0.tgz#f351d32969d32fa5d7a5567154263d928ae3bd1f"
167
168
-browserslist@^1.0.1, browserslist@^1.5.2:
169
- version "1.6.0"
170
- resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-1.6.0.tgz#85fb7c993540d3fda31c282baf7f5aee698ac9ee"
171
- dependencies:
172
- caniuse-db "^1.0.30000613"
173
- electron-to-chromium "^1.2.0"
174
175
-browserslist@~1.5.1:
+browserslist@^1.0.1, browserslist@^1.5.2, browserslist@~1.5.1:
176
version "1.5.2"
177
resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-1.5.2.tgz#1c82fde0ee8693e6d15c49b7bff209dc06298c56"
178
dependencies:
@@ -206,7 +199,7 @@ caniuse-api@^1.5.2:
206
199
lodash.uniq "^4.3.0"
207
200
shelljs "^0.7.0"
208
201
209
-caniuse-db@^1.0.30000346, caniuse-db@^1.0.30000604, caniuse-db@^1.0.30000613:
202
+caniuse-db@^1.0.30000346, caniuse-db@^1.0.30000604:
210
203
version "1.0.30000613"
211
204
resolved "https://registry.yarnpkg.com/caniuse-db/-/caniuse-db-1.0.30000613.tgz#639133b7a5380c1416f9701d23d54d093dd68299"
212
205
@@ -493,10 +486,6 @@ ecc-jsbn@~0.1.1:
493
486
494
487
jsbn "~0.1.0"
495
488
496
-electron-to-chromium@^1.2.0:
497
- version "1.2.0"
498
- resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.2.0.tgz#3bd7761f85bd4163602259ae6c7ed338050b17e7"
499
500
489
emojis-list@^2.0.0:
501
490
version "2.1.0"
502
491
resolved "https://registry.yarnpkg.com/emojis-list/-/emojis-list-2.1.0.tgz#4daa4d9db00f9819880c79fa457ae5b09a1fd389"
@@ -1107,14 +1096,13 @@ levn@^0.3.0, levn@~0.3.0:
1107
1096
prelude-ls "~1.1.2"
1108
1097
type-check "~0.3.2"
1109
1098
1110
-loader-utils@~0.2.2:
1111
- version "0.2.16"
1112
- resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-0.2.16.tgz#f08632066ed8282835dff88dfb52704765adee6d"
1099
+loader-utils@^1.0.2:
1100
+ version "1.0.3"
1101
+ resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-1.0.3.tgz#566c320c24c33cb3f02db4df83f3dbf60b253de3"
1113
1102
1114
1103
big.js "^3.1.3"
1115
1104
emojis-list "^2.0.0"
1116
1105
json5 "^0.5.0"
1117
- object-assign "^4.0.1"
1118
1106
1119
lodash._baseassign@^3.0.0:
1120
version "3.2.0"
0 commit comments