nx
nx copied to clipboard
webpack WriteIndexHtmlPlugin does not respect inject: false
Current Behavior
[email protected] in project.json i have:
{
"target":
"build": {
"options": {
"styles": [{ "input": "...", "bundleName": "...", "inject": false}, ..]
}
}
}
However, when I build the project, the generated HTML includes the CSS files mentioned in the styles field above, even though inject was set to false.
Expected Behavior
The expected behavior is for the HTML page not to include the styles marked with inject: false, leaving it up to the developer to inject them as necessary.
GitHub Repo
No response
Steps to Reproduce
- create style sheets
- add
inputbundleNameandinject:falsein project.json under build options. - build the app
- check the generated html file (it should not include the style files that marked as
injected:false
Nx Report
Node : 18.19.1
OS : darwin-arm64
yarn : 3.2.3
nx : 17.2.8
@nx/js : 17.2.8
@nx/jest : 17.2.8
@nx/linter : 17.2.8
@nx/eslint : 17.2.8
@nx/workspace : 17.2.8
@nx/devkit : 17.2.8
@nx/eslint-plugin : 17.2.8
@nx/express : 17.2.8
@nx/node : 17.2.8
@nx/playwright : 18.0.4
@nx/react : 17.2.8
@nx/rollup : 17.2.8
@nrwl/tao : 17.2.8
@nx/web : 17.2.8
@nx/webpack : 17.2.8
nx-cloud : 18.0.0
typescript : 4.9.3
Failure Logs
No response
Package Manager Version
No response
Operating System
- [X] macOS
- [ ] Linux
- [ ] Windows
- [ ] Other (Please specify)
Additional Information
No response
Hi! Could you please provide a repo with a minimal reproduction so that I can investigate this further?
This issue has been automatically marked as stale because no reproduction was provided within 7 days. Please help us help you. Providing a repository exhibiting the issue helps us diagnose and fix the issue. Any time that we spend reproducing this issue is time taken away from addressing this issue and other issues. This issue will be closed in 21 days if a reproduction is not provided. If a reproduction has been provided, please reply to keep it active. Thanks for being a part of the Nx community! 🙏
Closed by: https://github.com/nrwl/nx/pull/23444
This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.