Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
refactor: remove module option
BREAKING CHANGE: remove `module` option, use `modules` option instead
  • Loading branch information
alexander-akait committed Jul 4, 2018
commit b47c5663b7067b71158721d1da8c55e9ffb53388
2 changes: 1 addition & 1 deletion lib/loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ module.exports = function(content, map) {
var callback = this.async();
var query = loaderUtils.getOptions(this) || {};
var root = query.root;
var moduleMode = query.modules || query.module;
var moduleMode = query.modules;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

because this is a refactor, shouldn't we use const and let instead?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@shellscape also let's do it other PR, when we ship webpack-default in this repo

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK

var camelCaseKeys = query.camelCase || query.camelcase;
var sourceMap = query.sourceMap || false;
var resolve = createResolver(query.alias);
Expand Down
2 changes: 1 addition & 1 deletion lib/localsLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ module.exports = function(content) {
if(this.cacheable) this.cacheable();
var callback = this.async();
var query = loaderUtils.getOptions(this) || {};
var moduleMode = query.modules || query.module;
var moduleMode = query.modules;
var camelCaseKeys = query.camelCase || query.camelcase;
var resolve = createResolver(query.alias);

Expand Down
6 changes: 3 additions & 3 deletions test/localTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,18 +139,18 @@ describe("local", function() {
className: "_23J0282swY7bwvI2X4fHiV",
someId: "_3vpqN0v_IxlO3TzQjbpB33",
subClass: "_1s1VsToXFz17cPAltMg7jz"
}, "?module");
}, "?modules");
testLocal("class name parsing", ".-a0-34a___f { color: red; }", [
[1, "._3ZMCqVa1XidxdqbX65hZ5D { color: red; }", ""]
], {
"-a0-34a___f": "_3ZMCqVa1XidxdqbX65hZ5D"
}, "?module");
}, "?modules");
testLocal("imported values in decl", ".className { color: IMPORTED_NAME; }\n" +
":import(\"./vars.css\") { IMPORTED_NAME: primary-color; }", [
[1, "._className { color: red; }", ""]
], {
"className": "_className"
}, "?module&localIdentName=_[local]", {
}, "?modules&localIdentName=_[local]", {
"./vars.css": {
locals: {
"primary-color": "red"
Expand Down
2 changes: 1 addition & 1 deletion test/moduleTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ describe("module", function() {
var source = fs.readFileSync(path.join(testCasesPath, name, "source.css"), "utf-8");
var expected = fs.readFileSync(path.join(testCasesPath, name, "expected.css"), "utf-8");

test(name, source, expected, "?module&sourceMap&localIdentName=_[local]_");
test(name, source, expected, "?modules&sourceMap&localIdentName=_[local]_");
});
});