You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you use the NxAppWebpackPlugin in a project with the outputFileName option to rename the output file, you always get two files, a main.js and whatever is configured in the outputFileName.
Expected Behavior
I'd expect to only get one file in the output that matches the option in outputFileName, instead of an additional main.js.
The repository includes a workspace with the default node application generator output. The only change I made is to add the outputFileName option to have the output named index.js instead of main.js.
run nx build node-app
go to dist/apps/node-app, where there is now an index.js and a main.js file
I have been debugging this issue and managed to trace it to the call of applyBaseConfig. The second argument to this call, compiler.options contains a default entry for main. The Nx plugin will append any entries it calculates to the existing entries, which means if we rename the output, we always get the default main plus any other entries that the plugin added.
Below is the debug console for that particular call, which shows the default main entry.
The text was updated successfully, but these errors were encountered:
This issue has been automatically marked as stale because it hasn't had any activity for 6 months.
Many things may have changed within this time. The issue may have already been fixed or it may not be relevant anymore.
If at this point, this is still an issue, please respond with updated information.
It will be closed in 21 days if no further activity occurs.
Thanks for being a part of the Nx community! 🙏
Current Behavior
If you use the
NxAppWebpackPlugin
in a project with theoutputFileName
option to rename the output file, you always get two files, amain.js
and whatever is configured in theoutputFileName
.Expected Behavior
I'd expect to only get one file in the output that matches the option in
outputFileName
, instead of an additionalmain.js
.GitHub Repo
/~https://github.com/tbinna/nx-webpack-test
Steps to Reproduce
The repository includes a workspace with the default node application generator output. The only change I made is to add the
outputFileName
option to have the output namedindex.js
instead ofmain.js
.nx build node-app
dist/apps/node-app
, where there is now anindex.js
and amain.js
fileNx Report
Failure Logs
No response
Package Manager Version
No response
Operating System
Additional Information
I have been debugging this issue and managed to trace it to the call of
applyBaseConfig
. The second argument to this call,compiler.options
contains a default entry formain
. The Nx plugin will append any entries it calculates to the existing entries, which means if we rename the output, we always get the default main plus any other entries that the plugin added.Below is the debug console for that particular call, which shows the default
main
entry.The text was updated successfully, but these errors were encountered: