Skip to content

Commit 23a4301

Browse files
chore(deps): update globby (#641)
1 parent 5222a28 commit 23a4301

File tree

15 files changed

+292
-51
lines changed

15 files changed

+292
-51
lines changed

.eslintignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
/coverage
22
/dist
33
/node_modules
4-
/test/fixtures
4+
/test/fixtures
5+
/test/bundled

.eslintrc.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
module.exports = {
22
root: true,
3+
parser: "@babel/eslint-parser",
34
extends: ["@webpack-contrib/eslint-config-webpack", "prettier"],
45
};

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ npm-debug.log*
1010
/node_modules
1111
/test/fixtures/\[special\$directory\]
1212
/test/outputs
13+
/test/bundled
1314

1415
.DS_Store
1516
Thumbs.db

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@
22
/dist
33
/node_modules
44
/test/fixtures
5+
/test/bundled
56
CHANGELOG.md

babel.config.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ module.exports = (api) => {
99
[
1010
"@babel/preset-env",
1111
{
12+
exclude:
13+
process.env.NODE_ENV === "test" ? [] : ["proposal-dynamic-import"],
1214
targets: {
1315
node: "12.13.0",
1416
},

globalSetup.js

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ const fs = require("fs");
33

44
// eslint-disable-next-line import/no-extraneous-dependencies
55
const mkdirp = require("mkdirp");
6+
const webpack = require("webpack");
67

78
const removeIllegalCharacterForWindows = require("./test/helpers/removeIllegalCharacterForWindows");
89

@@ -23,4 +24,43 @@ module.exports = () => {
2324

2425
fs.writeFileSync(path.join(baseDir, file), specialFiles[originFile]);
2526
});
27+
28+
return Promise.resolve()
29+
.then(() => {
30+
const compiler = webpack({
31+
devtool: false,
32+
mode: "development",
33+
target: "node",
34+
entry: path.resolve(__dirname, "node_modules/globby/index.js"),
35+
output: {
36+
path: path.resolve(__dirname, "test/bundled/globby"),
37+
filename: "index.js",
38+
library: {
39+
type: "commonjs2",
40+
},
41+
},
42+
});
43+
44+
return new Promise((resolve, reject) => {
45+
compiler.run((error, stats) => {
46+
if (error) {
47+
reject(error);
48+
49+
return;
50+
}
51+
52+
// eslint-disable-next-line no-console
53+
console.log(stats.toString());
54+
55+
compiler.close(() => {
56+
resolve();
57+
});
58+
});
59+
});
60+
})
61+
.catch((error) => {
62+
// eslint-disable-next-line no-console
63+
console.log(error);
64+
process.exit(1);
65+
});
2666
};

jest.config.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
11
module.exports = {
22
testEnvironment: "node",
3+
moduleNameMapper: {
4+
"^globby$": "<rootDir>/test/bundled/globby/index.js",
5+
"^node:fs$": "<rootDir>/test/helpers/built-in-modules/fs.js",
6+
"^node:util$": "<rootDir>/test/helpers/built-in-modules/util.js",
7+
"^node:path$": "<rootDir>/test/helpers/built-in-modules/path.js",
8+
"^node:stream$": "<rootDir>/test/helpers/built-in-modules/stream.js",
9+
},
310
globalSetup: "<rootDir>/globalSetup.js",
411
};

0 commit comments

Comments
 (0)