-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
External styles added to project.json with inject=false is being injected into html #20049
Closed
1 of 4 tasks
Labels
Comments
Hi there! |
Coly010
added a commit
that referenced
this issue
May 16, 2024
Coly010
added a commit
that referenced
this issue
May 16, 2024
…20049 (#23444) <!-- Please make sure you have read the submission guidelines before posting an PR --> <!-- https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr --> <!-- Please make sure that your commit message follows our format --> <!-- Example: `fix(nx): must begin with lowercase` --> ## Current Behavior <!-- This is the behavior we have today --> We are still injecting `styles` and `scripts` even if `inject=false` in `project.json`. ## Expected Behavior <!-- This is the behavior we should expect with the changes in this PR --> Do not inject styles and scripts if `inject=false` ## Related Issue(s) <!-- Please link the issue being fixed so it gets closed when this is merged. --> Fixes #20049
FrozenPandaz
pushed a commit
that referenced
this issue
May 21, 2024
…20049 (#23444) <!-- Please make sure you have read the submission guidelines before posting an PR --> <!-- https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr --> <!-- Please make sure that your commit message follows our format --> <!-- Example: `fix(nx): must begin with lowercase` --> ## Current Behavior <!-- This is the behavior we have today --> We are still injecting `styles` and `scripts` even if `inject=false` in `project.json`. ## Expected Behavior <!-- This is the behavior we should expect with the changes in this PR --> Do not inject styles and scripts if `inject=false` ## Related Issue(s) <!-- Please link the issue being fixed so it gets closed when this is merged. --> Fixes #20049 (cherry picked from commit 504d048)
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. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Current Behavior
When I set the 'inject' property to 'false' for an external style added in project.json, it is still being injected into the HTML.
apps/test-app/project.json
dist/apps/test-app/index.html
(after running
nx run-many --target=build --all --configuration=development --verbose
)Expected Behavior
I expected that when I set the 'inject' property to 'false' for an external style added in project.json, it should not be injected into the HTML. The 'inject' property set to 'false' should prevent the style from being included in the final HTML output.
GitHub Repo
https://github.com/kryaksy/nx-external-styles-issue-poc.git
Steps to Reproduce
nx run-many --target=build --all --configuration=development
and check the index.html inside the dist/apps/test-app/index.html file if the external style element is injected.Before steps:
npx create-nx-workspace@latest
npx nx generate @nx/js:library --name=shared --unitTestRunner=none --minimal=true --projectNameAndRootFormat=as-provided --strict=false --no-interactive
dark.less
dummy style file intoshared/src/styles/themes/
nx run-many --target=build --all --configuration=development
Nx Report
Failure Logs
No response
Package Manager Version
No response
Operating System
Additional Information
Note: I'm not entirely sure if I've made a mistake in my configuration or if the issue might not be related to Nx
The text was updated successfully, but these errors were encountered: