-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Add more support in @wordpress/scripts to widen the usage of the package #27581
Comments
The interesting part is that also today we have been discussing support for fonts in #27565 in a completely different issue. In the gist, in the tutorial there was a section that explained how to add support to webpack for fonts 😄
|
Thank you for starting the discussion during the weekly WordPress Core JS chat. I'm personally open to adding more changes like that since it shouldn't impact the size of ImagesFontsI couldn't find a specific section but there is catch it all that might trigger in this situation: |
@kimmenbert, I have a working proposal in #28043. I found a way to work around this annoying issue with |
* Scripts: Add supports for static assets in build commands Fixes #27581. * Docs: Add details how to use fonts and images * Use file loader for images
I think @wordpress/scripts could be the build tool to turn to when in need of build tool in WordPress theme / plugin development.
So far using it in theme, with both .js files and .scss files as entry points I have encountered these issues:
Got this working by extending @wordpress/scripts webpack file to include support for those.
After support got added there was another issue caused by the CleanWebpackPlugin plugin. The images / fonts will be generated every build and on the initial
wp-scripts start
but while watching and recompiling the files is removed and not re-compiled.My addition to the webpack config:
The text was updated successfully, but these errors were encountered: