-
Notifications
You must be signed in to change notification settings - Fork 12.2k
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
Mark css as having side effects in @fortawesome/fontawesome-svg-core #18654
Conversation
Just ran into the same issue. Please fix for CSP compatibility 👍🏾 |
Thanks for the report! We can get this done. Out of curiosity, @GertSallaerts have you confirmed that this change fixes the issue for you? |
@robmadole yes, this fixed the problem for us. |
@robmadole Can we please move forward on this? 🙂 |
Hello
My dear friend, I did not understand exactly what you meant.
Can you explain more?
Nik Sauer ***@***.***> در تاریخ چهارشنبه ۸ ژوئن ۲۰۲۲
ساعت ۲۰:۳۶ نوشت:
… @robmadole <https://github.com/robmadole> Can we please move forward on
this? 🙂
—
Reply to this email directly, view it on GitHub
<#18654 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AH3WNYG7OBC5Z7LTBYTPTMTVODAHDANCNFSM5N2RBA4Q>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
@robmadole Should I open a rebased PR or how would you like to proceed? We'd love to upgrade to v6 but this is a blocker. |
This has been fixed in 6.1.0 Closing here, thanks for the PR
|
Mimic FontAwesome's `package.json`. - Add `style` package export - Add `styles.scss` and `styles` exports - Add `styles.scss` to "side effects" to prevent issues with tree-shaking With this commit, it is possible to import the style with the following approaches: ```scss @import "choices.js"; @import "choices.js/styles"; @import "choices.js/styles.scss"; ``` Refs: - https://webpack.js.org/guides/package-exports/ - FortAwesome/Font-Awesome#18654 Close Choices-js#1184
Mimic FontAwesome's `package.json`. - Add `style` package export for webpack - Add `sass` package export for webpack - Add `styles.css` and `styles` exports for main CSS file - Add `*.scss` and `*.css` to "side effects" to prevent issues with tree-shaking With this commit, it is possible to import the style with the following approaches: ```css @import "choices.js"; @import "choices.js/styles"; @import "choices.js/styles.css"; ``` ```scss @import "choices.js"; ``` Refs: - https://webpack.js.org/guides/package-exports/ - FortAwesome/Font-Awesome#18654 Close Choices-js#1184
Mimic FontAwesome's `package.json`. - Add `style` package export for webpack - Add `sass` package export for webpack - Add `styles.css` and `styles` exports for main CSS file - Add `*.scss` and `*.css` to "side effects" to prevent issues with tree-shaking With this commit, it is possible to import the style with the following approaches: ```css @import "choices.js"; @import "choices.js/styles"; @import "choices.js/styles.css"; ``` ```scss @import "choices.js"; ``` Refs: - https://webpack.js.org/guides/package-exports/ - FortAwesome/Font-Awesome#18654 Close Choices-js#1184
Mimic FontAwesome's `package.json` to improve compatibility with webpack - Add `style` package export to allow main CSS import from JavaScript - Add `sass` package export to allow - Add `styles.css` and `styles` exports for main CSS file - Add `*.scss` and `*.css` to "side effects" to prevent issues with tree-shaking With this commit, it is possible to import the style with the following approaches: ```js import "choices.js"; import "choices.js/styles"; import "choices.js/styles.css"; ``` ```scss @import "choices.js"; ``` Refs: - https://webpack.js.org/guides/package-exports/ - FortAwesome/Font-Awesome#18654 Close Choices-js#1184
We are manually importing the
styles.css
file in our project (to make our site work with our CSP policy as described in the docs) by including animport '@fortawesome/fontawesome-svg-core/styles.css';
statement in our code. This was working perfectly before the 1.3 release of@fortawesome/fontawesome-svg-core
but because of thesideEffects
configuration, webpack is now treeshaking the CSS out of our build.We have some other workarounds available to use but thought it might help other users to include it here?