Skip to content

Commit

Permalink
fix: ci
Browse files Browse the repository at this point in the history
  • Loading branch information
snitin315 committed Sep 24, 2022
1 parent 2eb2f22 commit 11cc040
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
13 changes: 9 additions & 4 deletions packages/webpack-cli/src/webpack-cli.ts
Expand Up @@ -144,14 +144,19 @@ class WebpackCLI implements IWebpackCLI {
return true;
}

// Respect NODE_PATH environment variable
if (
process.env.NODE_PATH &&
fs.statSync(path.join(process.env.NODE_PATH, packageName)).isDirectory()
) {
return true;
}

let dir = __dirname;

do {
try {
const packagePath = process.env.NODE_PATH
? path.join(process.env.NODE_PATH, packageName)
: path.join(dir, "node_modules", packageName);
if (fs.statSync(packagePath).isDirectory()) {
if (fs.statSync(path.join(dir, "node_modules", packageName)).isDirectory()) {
return true;
}
} catch (_error) {
Expand Down
3 changes: 1 addition & 2 deletions scripts/globalSetup.js
@@ -1,4 +1,3 @@
const { version } = require("webpack");

module.exports = () =>
console.log(`\n Running tests for webpack @${version} \n NODE_PATH-> ${process.env.NODE_PATH}`);
module.exports = () => console.log(`\n Running tests for webpack @${version} \n`);
5 changes: 1 addition & 4 deletions test/utils/test-utils.js
Expand Up @@ -53,10 +53,7 @@ const createProcess = (cwd, args, options) => {
reject: false,
stdio: ENABLE_LOG_COMPILATION ? "inherit" : "pipe",
maxBuffer: Infinity,
env: {
WEBPACK_CLI_HELP_WIDTH: 1024,
NODE_PATH: path.resolve(__dirname, "../../node_modules"),
},
env: { WEBPACK_CLI_HELP_WIDTH: 1024 },
...options,
});
};
Expand Down

0 comments on commit 11cc040

Please sign in to comment.