-
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
Document which packages are compatible with Dependency Extraction Webpack Plugin #60258
Comments
I believe that's an intentional choice. See #19809. |
Ok, that's interesting. I would not ever have guessed that. |
Based on the conversation in the original PR, I'll close this as "won't fix" for now. |
Is there a list of packages we should expect the dependency extraction plugin to work on? If not, could we add that to docu ? |
Here's the current list:
|
Can that be added to the readme then? And that can't be the full list? What about data, elements, components, etc? |
Oh, sorry. That's the list of the packages that aren't handled by dependency extraction and need to be bundled with your code. The script will handle every other package included in the editor.
Do you want to update the title and description of the issue? Let's re-open it as a documentation update request. cc @gziolo, @ryanwelcher |
The packages that are bundled are considered private. That's the design decision. For example, after a long period of testing the assumptions made about Let's document the list of supported packages and related WP script handles in the documentation of the package. |
Correct me if I'm wrong, but regardless of which packages are private or not, if you import a package like Even if a package is properly externalized, having the dependencies installed locally helps with IDE integration (autocomplete, etc.) |
In case it's externalized, then webpack will ignore the import and replace it with
However, I agree with the reasoning that installing the package locally will vastly improve the development workflow. |
I encountered this issue recently. I have the |
They should probably be installed as regular dependencies then. Icons will then be bundled while the rest won‘t |
It doesn't make sense to install packages in deployment that are not needed, as it significantly impacts the installation speed. Only the Icons should be installed as a regular dependency. |
Description
I have the dependency extraction webpack plugin enabled in my webpack.config.js
But in my block I am attempting to import an icon from
@wordpress/icons
and when I run
npm run start
I get the following error that icons cannot be resolved.Step-by-step reproduction instructions
@wordpress/icons
somewhere in your scriptsScreenshots, screen recording, code snippet
No response
Environment info
Gutenberg Version 17.8.2
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
No
The text was updated successfully, but these errors were encountered: