webpack: Use relative resolve path for npm 7 compatibility
npm 7 changed how it resolves dependencies, and cockpit-machines fails
to build with lots of unresolved peer dependencies of PatternFly.
With an absolute path, `resolve.modules` will only look in that
directory; the default is a relative path "node_modules" that just
works [1]. We need to keep the `$SRCDIR` support, but convert the path
to a relative one to keep the old recursive search behaviour.
This magically fixes the label alignment in dialogs, update the pixel
test references accordingly.
[1] https://webpack.js.org/configuration/resolve/#resolvemodules
See also a117600dff
This commit is contained in:
parent
abc5922946
commit
03a5445b35
1 changed files with 2 additions and 1 deletions
|
|
@ -15,7 +15,8 @@ const builddir = process.env.SRCDIR || __dirname;
|
|||
const distdir = builddir + path.sep + "dist";
|
||||
const section = process.env.ONLYDIR || null;
|
||||
const libdir = path.resolve(srcdir, "lib")
|
||||
const nodedir = path.resolve(process.env.SRCDIR || __dirname, "node_modules");
|
||||
// absolute path disables recursive module resolution, so build a relative one
|
||||
const nodedir = path.relative(process.cwd(), path.resolve((process.env.SRCDIR || __dirname), "node_modules"));
|
||||
|
||||
/* A standard nodejs and webpack pattern */
|
||||
var production = process.env.NODE_ENV === "production";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue