Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
2,995 changes: 1,244 additions & 1,751 deletions package-lock.json

Large diffs are not rendered by default.

30 changes: 15 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,46 +45,46 @@
"dependencies": {
"camelcase": "^6.2.0",
"cssesc": "^3.0.0",
"icss-utils": "^5.0.0",
"icss-utils": "^5.1.0",
"loader-utils": "^2.0.0",
"postcss": "^8.1.7",
"postcss": "^8.2.4",
"postcss-modules-extract-imports": "^3.0.0",
"postcss-modules-local-by-default": "^4.0.0",
"postcss-modules-scope": "^3.0.0",
"postcss-modules-values": "^4.0.0",
"postcss-value-parser": "^4.1.0",
"schema-utils": "^3.0.0",
"semver": "^7.3.2"
"semver": "^7.3.4"
},
"devDependencies": {
"@babel/cli": "^7.12.1",
"@babel/core": "^7.12.3",
"@babel/preset-env": "^7.12.1",
"@babel/cli": "^7.12.13",
"@babel/core": "^7.12.13",
"@babel/preset-env": "^7.12.13",
"@commitlint/cli": "^11.0.0",
"@commitlint/config-conventional": "^11.0.0",
"@webpack-contrib/defaults": "^6.3.0",
"@webpack-contrib/eslint-config-webpack": "^3.0.0",
"babel-jest": "^26.6.3",
"cross-env": "^7.0.2",
"cross-env": "^7.0.3",
"del": "^6.0.0",
"del-cli": "^3.0.1",
"es-check": "^5.1.2",
"eslint": "^7.13.0",
"eslint-config-prettier": "^6.15.0",
"es-check": "^5.2.0",
"eslint": "^7.19.0",
"eslint-config-prettier": "^7.2.0",
"eslint-plugin-import": "^2.22.1",
"file-loader": "^6.2.0",
"husky": "^4.3.0",
"husky": "^4.3.8",
"jest": "^26.6.3",
"less": "^3.12.2",
"less": "^4.1.1",
"less-loader": "^7.1.0",
"lint-staged": "^10.5.1",
"lint-staged": "^10.5.3",
"memfs": "^3.2.0",
"mini-css-extract-plugin": "^1.3.1",
"mini-css-extract-plugin": "^1.3.5",
"npm-run-all": "^4.1.5",
"postcss-loader": "^4.0.4",
"postcss-preset-env": "^6.7.0",
"prettier": "^2.1.2",
"sass": "^1.29.0",
"sass": "^1.32.6",
"sass-loader": "^10.1.0",
"standard-version": "^9.0.0",
"strip-ansi": "^6.0.0",
Expand Down
4 changes: 1 addition & 3 deletions src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -662,9 +662,7 @@ function getExportCode(exports, replacements, options) {

async function resolveRequests(resolve, context, possibleRequests) {
return resolve(context, possibleRequests[0])
.then((result) => {
return result;
})
.then((result) => result)
.catch((error) => {
const [, ...tailPossibleRequests] = possibleRequests;

Expand Down
5 changes: 2 additions & 3 deletions test/helpers/compile.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export default (compiler) => {
return new Promise((resolve, reject) => {
export default (compiler) =>
new Promise((resolve, reject) => {
compiler.run((error, stats) => {
if (error) {
return reject(error);
Expand All @@ -8,4 +8,3 @@ export default (compiler) => {
return resolve(stats);
});
});
};
5 changes: 2 additions & 3 deletions test/helpers/getErrors.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import normalizeErrors from "./normalizeErrors";

export default (stats, shortError, type) => {
return normalizeErrors(stats.compilation.errors, shortError, type).sort();
};
export default (stats, shortError, type) =>
normalizeErrors(stats.compilation.errors, shortError, type).sort();
4 changes: 1 addition & 3 deletions test/helpers/getWarnings.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import normalizeErrors from "./normalizeErrors";

export default (stats) => {
return normalizeErrors(stats.compilation.warnings).sort();
};
export default (stats) => normalizeErrors(stats.compilation.warnings).sort();
5 changes: 2 additions & 3 deletions test/helpers/normalizeErrors.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ function removeCWD(str) {
.replace(new RegExp(cwd, "g"), "");
}

export default (errors, shortError, type) => {
return errors.map((error) => {
export default (errors, shortError, type) =>
errors.map((error) => {
let errorMessage = error.toString();

if (shortError) {
Expand All @@ -50,4 +50,3 @@ export default (errors, shortError, type) => {

return removeCWD(errorMessage.split("\n").slice(0, 12).join("\n"));
});
};
4 changes: 1 addition & 3 deletions test/modules-option.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -676,9 +676,7 @@ describe('"modules" option', () => {
it("issue #1063 throw error", async () => {
const compiler = getCompiler("./modules/issue-1063/issue-1063.js", {
modules: {
mode: () => {
return "not local, global or pure";
},
mode: () => "not local, global or pure",
},
});
const stats = await compile(compiler);
Expand Down
28 changes: 7 additions & 21 deletions test/runtime/api.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,15 @@ describe("api", () => {
});

it("should toString a single module", () => {
const m = api(function (i) {
return i[1];
});
const m = api((i) => i[1]);

m.push([1, "body { a: 1; }", ""]);

expect(m.toString()).toMatchSnapshot();
});

it("should toString multiple modules", () => {
const m = api(function (i) {
return i[1];
});
const m = api((i) => i[1]);

m.push([2, "body { b: 2; }", ""]);
m.push([1, "body { a: 1; }", ""]);
Expand All @@ -48,9 +44,7 @@ describe("api", () => {
});

it("should toString with media query", () => {
const m = api(function (i) {
return i[1];
});
const m = api((i) => i[1]);

const m1 = [1, "body { a: 1; }", "screen"];
const m2 = [2, "body { b: 2; }", ""];
Expand All @@ -66,9 +60,7 @@ describe("api", () => {
});

it("should import modules", () => {
const m = api(function (i) {
return i[1];
});
const m = api((i) => i[1]);
const m1 = [1, "body { a: 1; }", "(orientation:landscape)"];
const m2 = [2, "body { b: 2; }", ""];
const m3 = [3, "body { c: 3; }", ""];
Expand All @@ -84,9 +76,7 @@ describe("api", () => {
});

it("should import named modules", () => {
const m = api(function (i) {
return i[1];
});
const m = api((i) => i[1]);
const m1 = ["./module1", "body { a: 1; }", "screen"];
const m2 = ["./module2", "body { b: 2; }", ""];
const m3 = ["./module3", "body { c: 3; }", ""];
Expand Down Expand Up @@ -156,9 +146,7 @@ describe("api", () => {
});

it("should import modules with dedupe", () => {
const m = api(function (i) {
return i[1];
});
const m = api((i) => i[1]);

const m1 = [null, "body { b: 1; }", ""];
const m2 = ["./module2", "body { b: 2; }", ""];
Expand All @@ -175,9 +163,7 @@ describe("api", () => {
});

it("should import modules when module string", () => {
const m = api(function (i) {
return i[1];
});
const m = api((i) => i[1]);

m.i(".button { b: 2; }");
m.i("");
Expand Down
4 changes: 2 additions & 2 deletions test/sourceMap-option.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,7 @@ describe('"sourceMap" option', () => {

expect(chunkName).toBe(
webpack.version[0] === "5"
? "main.c3447e78abcd04637737.bundle.js"
? "main.bac0eaf8cd232e2ae9a6.bundle.js"
: "main.19efc497c5c37fc5e355.bundle.js"
);
expect(
Expand Down Expand Up @@ -609,7 +609,7 @@ describe('"sourceMap" option', () => {

expect(chunkName).toBe(
// TODO still buggy on webpack@4
webpack.version[0] === "5" ? "main.0c4134a13ce273487b87.css" : chunkName
webpack.version[0] === "5" ? "main.695010bdb768b7260e76.css" : chunkName
);

expect(
Expand Down