angular-architects / module-federation-plugin

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

OutputNames property lacks hash when outputHasing is set to All and makes impossible to use url in scss for themes

Lindvorn opened this issue · comments

In a project we use themes in css, each theme has a named folder with images of the same name.
In order to resolve the error:
"error: Two output files share the same path but have different contents: media\xxxxx.png"
with stack trace:
at failureErrorWithLog (E:\web-jetfile\src\Jetfile.Web\node_modules\esbuild\lib\main.js:1651:15)
at E:\web-jetfile\src\Jetfile.Web\node_modules\esbuild\lib\main.js:1059:25
at E:\web-jetfile\src\Jetfile.Web\node_modules\esbuild\lib\main.js:1527:9
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

we have to add outputHasing: 'all' to angular.json.
When we use this lib we encounter the same error as above but there's no way to overcome it.
In the angular esBuld node_modules@angular-devkit\build-angular\src\builders\application\options.js they have
const outputNames = { bundles: options.outputHashing === schema_1.OutputHashing.All || options.outputHashing === schema_1.OutputHashing.Bundles ? '[name]-[hash]' : '[name]', media: outputOptions.media + (options.outputHashing === schema_1.OutputHashing.All || options.outputHashing === schema_1.OutputHashing.Media ? '/[name]-[hash]' : '/[name]'), };
whereas in angular-architect in the node_modules@angular-architects\native-federation\src\utils\angular-esbuild-adapter.js outputHashing has no power.
Can you please, add use of outputHashing into esBuildAdapter so we can use this lib with esBuild?

Thanks for pointing this out. It's now on the list for the next version