Skip to content

Commit

Permalink
Fix build artifact issues after nx 17 upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
brionmario committed Jul 23, 2024
1 parent e4766f5 commit 4b1b840
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 9 deletions.
8 changes: 5 additions & 3 deletions apps/console/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@
"optimization": false,
"sourceMap": true,
"vendorChunk": true,
"verbose": true
"verbose": true,
"extractCss": false
},
"production": {
"index": "index.jsp",
Expand All @@ -100,7 +101,8 @@
"outputHashing": "all",
"sourceMap": false,
"extractLicenses": false,
"verbose": true
"verbose": true,
"extractCss": false
}
}
},
Expand Down Expand Up @@ -212,4 +214,4 @@
}
}
}
}
}
9 changes: 6 additions & 3 deletions apps/console/webpack.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -561,10 +561,13 @@ module.exports = (config: WebpackOptionsNormalized, context: NxWebpackContextInt

if (rule.test.toString().includes("svg") && rule.test instanceof RegExp) {
rule.use instanceof Array && rule.use.forEach((item: RuleSetUseItem) => {
if (typeof item !== "string" && (item as any).loader.includes("url-loader")) {
if (
typeof item !== "string" &&
((item as any).loader.includes("url-loader") || (item as any).loader.includes("file-loader"))
) {
(item as any).options.name = isProduction
? `${ RELATIVE_PATHS.staticMedia }/[contenthash].[ext]`
: `${ RELATIVE_PATHS.staticMedia }/[path][name].[ext]`;
? `${RELATIVE_PATHS.staticMedia}/[contenthash].[ext]`
: `${RELATIVE_PATHS.staticMedia}/[path][name].[ext]`;
}
});
}
Expand Down
6 changes: 4 additions & 2 deletions apps/myaccount/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@
"optimization": false,
"sourceMap": true,
"vendorChunk": true,
"verbose": true
"verbose": true,
"extractCss": false
},
"production": {
"index": "index.jsp",
Expand All @@ -95,7 +96,8 @@
"outputHashing": "all",
"sourceMap": false,
"extractLicenses": false,
"verbose": true
"verbose": true,
"extractCss": false
}
}
},
Expand Down
5 changes: 4 additions & 1 deletion apps/myaccount/webpack.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,10 @@ module.exports = (config: WebpackOptionsNormalized, context: NxWebpackContextInt
if (rule.test.toString().includes("svg") && rule.test instanceof RegExp) {
rule.use instanceof Array &&
rule.use.forEach((item: RuleSetUseItem) => {
if (typeof item !== "string" && (item as any).loader.includes("url-loader")) {
if (
typeof item !== "string" &&
((item as any).loader.includes("url-loader") || (item as any).loader.includes("file-loader"))
) {
(item as any).options.name = isProduction
? `${RELATIVE_PATHS.staticMedia}/[contenthash].[ext]`
: `${RELATIVE_PATHS.staticMedia}/[path][name].[ext]`;
Expand Down

0 comments on commit 4b1b840

Please sign in to comment.