Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

4
  • What does your current webpack.config.js look like? And what WP version are you using? Commented Sep 3, 2021 at 12:59
  • You should share your webpack.config.js. Based on what you wrote, you should have an entry object in config with 2 bundles, one for js and one for ui. Usually these bundles point to a main file main.js*/*index.js and those files imports/requires all the necessary stuff, webpack will load them if paths are accessible in dev/prod mode. Commented Sep 3, 2021 at 13:11
  • You are right, I am quite newbie to webpack. There are some entry points and it should not be any problem to pass path like '../ui/main.js'. Now I feel very foolish. Thank you @darklightcode, if you make an answer from your comment, I can mark it as a solution. New entry point for ui target, how simple is it. Commented Sep 3, 2021 at 18:18
  • @Honza you can check my answer and make sure to read the important note! at the end. Commented Sep 3, 2021 at 19:11