-
DescriptionWe have a plugin that requires multiple webpack exports in separate nested folders by using an array of objects with unique properties (see example below). The issue we are experiencing has to do with using {{{npm run start}}} from the wp-scripts package. Whenever a change is made and the webpack watcher updates the dist files, the last set of scripts (in this case example c) do not get exported and I end up with an empty dist folder. However, if the edited script resides in example-c, the files are properly exported. I have spent a few days troubleshooting but have not figured out why this happens. Here are some notes that I have gathered:
Step-by-step reproduction instructions
Expected behaviourWatch files and update them based on changes. Actual behaviourDeletes the last batch of scripts even when no changes were made in those files. Code snippet (optional)
WordPress information
Device information
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
It looks like a very advanced use case with multiple webpack configs and multiple entry points. I'm afraid I can't help as it requires a deep understanding of how webpack works. It's definitely out of the scope of what gutenberg/packages/scripts/config/webpack.config.js Lines 204 to 210 in 8035392 It removes stale files during rebuilds. Maybe it doesn't work properly for such a complex setup? |
Beta Was this translation helpful? Give feedback.
It looks like a very advanced use case with multiple webpack configs and multiple entry points. I'm afraid I can't help as it requires a deep understanding of how webpack works. It's definitely out of the scope of what
@wordpress/scripts
is able to support out of the box. The only pointer I can give you is this plugin:gutenberg/packages/scripts/config/webpack.config.js
Lines 204 to 210 in 8035392