webpack: Use default resolve path for npm 7 compatibility
npm 7 changed how it resolves dependencies, and starter-kit 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]. Use that default, as we don't use `$SRCDIR` in this project anyway. [1] https://webpack.js.org/configuration/resolve/#resolvemodules
This commit is contained in:
parent
8074af0fbd
commit
0abeda3528
1 changed files with 3 additions and 5 deletions
|
|
@ -15,8 +15,6 @@ crypto.createHash = algorithm => crypto_orig_createHash(algorithm == "md4" ? "sh
|
||||||
|
|
||||||
const webpack = require("webpack");
|
const webpack = require("webpack");
|
||||||
|
|
||||||
const nodedir = path.resolve((process.env.SRCDIR || __dirname), "node_modules");
|
|
||||||
|
|
||||||
/* A standard nodejs and webpack pattern */
|
/* A standard nodejs and webpack pattern */
|
||||||
const production = process.env.NODE_ENV === 'production';
|
const production = process.env.NODE_ENV === 'production';
|
||||||
|
|
||||||
|
|
@ -44,11 +42,11 @@ if (production) {
|
||||||
module.exports = {
|
module.exports = {
|
||||||
mode: production ? 'production' : 'development',
|
mode: production ? 'production' : 'development',
|
||||||
resolve: {
|
resolve: {
|
||||||
modules: [ nodedir, path.resolve(__dirname, 'src/lib') ],
|
modules: [ "node_modules", path.resolve(__dirname, 'src/lib') ],
|
||||||
alias: { 'font-awesome': path.resolve(nodedir, 'font-awesome-sass/assets/stylesheets') },
|
alias: { 'font-awesome': 'font-awesome-sass/assets/stylesheets' },
|
||||||
},
|
},
|
||||||
resolveLoader: {
|
resolveLoader: {
|
||||||
modules: [ nodedir, path.resolve(__dirname, 'src/lib') ],
|
modules: [ "node_modules", path.resolve(__dirname, 'src/lib') ],
|
||||||
},
|
},
|
||||||
watchOptions: {
|
watchOptions: {
|
||||||
ignored: /node_modules/,
|
ignored: /node_modules/,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue