nx icon indicating copy to clipboard operation
nx copied to clipboard

webpack WriteIndexHtmlPlugin does not respect inject: false

Open Janim007 opened this issue 1 year ago • 2 comments
trafficstars

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

  1. create style sheets
  2. add input bundleName and inject:false in project.json under build options.
  3. build the app
  4. 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

Janim007 avatar Feb 22 '24 18:02 Janim007

Hi! Could you please provide a repo with a minimal reproduction so that I can investigate this further?

Coly010 avatar May 10 '24 09:05 Coly010

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! 🙏

github-actions[bot] avatar May 18 '24 00:05 github-actions[bot]

Closed by: https://github.com/nrwl/nx/pull/23444

Coly010 avatar May 20 '24 10:05 Coly010

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.

github-actions[bot] avatar Jun 20 '24 00:06 github-actions[bot]