-
Notifications
You must be signed in to change notification settings - Fork 7
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
How Webpack and WordPress packages interact #79
Comments
@ryanwelcher post a preliminary outline in this comment I'd probably start with the relationship between the @wordpress/scripts package and the [DependencyExtractionPlugin](https://www.npmjs.com/package/@wordpress/dependency-extraction-webpack-plugin) to clarify: |
Draft is (finally) ready for review - https://docs.google.com/document/d/1qsfWjkWyAyRcoLHaEM8WelDSrXhhzVZXOnwjKcxPBD0/edit# |
Got a couple of things on my plate today. Can I look early-ish tomorrow? |
This is ready for 2nd review - https://developer.wordpress.org/news/?p=1226&preview=1&_ppp=305a6df22c |
Omg thank you for saying something! Absolutely!... from my phoneOn Apr 24, 2023, at 8:30 AM, Ryan Welcher ***@***.***> wrote:
@marybaum do you think you'll have some time to review the post today?
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Done! |
@ryanwelcher seems you are ready to publish! ✅ Here is the pre-publish checklist
|
Post was published by @ryanwelcher How webpack and WordPress packages interact |
Discussed in #15
Originally posted by bph October 13, 2022
During the discussion Issue #8
@andrewlimaza commented
"The main hurdle is the tooling around here and not fully understanding webpack. We tweak the wordpress/scripts webpack to adjust the entry and output points to fit our file structure. What we need is to output to assets/js and entry point would be /blocks (with various subfolders).
Right now, it nukes everything in the assets/js whenever you use wp-scripts start or build. Not sure if this is a NPM version thing or if there's a setting we can use to keep pre-existing files (other .js files for plugin frontend/admin etc) and just rebuild the files we need (i.e. blocks.build.js).
Also a standardized file structure for blocks (within a plugin) would help us, this is something we're working on for our own team (not paving the way for WP) but with the ever evolving tools and understanding of blocks we need to neaten this up internally as we built blocks before wp-scripts was a thing or we just didn't know about it (I can't remember 5 years ago what was our thought approach). We have moved over to wp-scripts ever since which made things easier but still gets confusing to troubleshoot this when things don't work. Our goal now is to to move to a set file structure and webpack config in upcoming plugins that already have shortcodes and other /js files. We have made some workarounds but I don't feel that these are ideal."
There definitely a need to elaborate on the interaction between Webpack and WordPress scripts, to guide developers through the build process and make adopting some tools easier. What do you think should be covered in a first blog post about it?
The text was updated successfully, but these errors were encountered: