Skip to content

Commit c596cd4

Browse files
fix: use regex includes in webpack CSS rules for highlight.js
The previous commit added highlight.js to the path-string include list but path.resolve string comparison was not matching subdirectories reliably. Switch both prod and dev CSS rules to use regex includes (/node_modules[\\/]highlight\.js/ and /node_modules[\\/]@patternfly[\\/]chatbot/) which unambiguously match the module paths webpack resolves. Build now passes with 0 errors (TypeScript 6.0.3, ignoreDeprecations: "6.0"). Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 0efc8b4 commit c596cd4

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

hpux-prototypes/webpack.dev.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ export default merge(common('development'), {
2828
test: /\.css$/,
2929
include: [
3030
...stylePaths,
31-
path.resolve('./node_modules/@patternfly/chatbot'),
32-
path.resolve('./node_modules/highlight.js'),
31+
/node_modules[\\/]@patternfly[\\/]chatbot/,
32+
/node_modules[\\/]highlight\.js/,
3333
],
3434
use: ['style-loader', 'css-loader'],
3535
},

hpux-prototypes/webpack.prod.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ export default merge(common('production'), {
3333
test: /\.css$/,
3434
include: [
3535
...stylePaths,
36-
path.resolve('./node_modules/@patternfly/chatbot'),
37-
path.resolve('./node_modules/highlight.js'),
36+
/node_modules[\\/]@patternfly[\\/]chatbot/,
37+
/node_modules[\\/]highlight\.js/,
3838
],
3939
use: [MiniCssExtractPlugin.loader, 'css-loader'],
4040
},

0 commit comments

Comments
 (0)