What does --experimental-scope-hoisting do?


I am currently preparing a new release of my plugin but then got a huge problem in the panel. I am using my own panel sections and while working on the plugin with yarn dev everything was fine. I then built a package using yarn build and tried that package out. It totaly broke my js, no section (even of other plugins) were working anymore because my plugins js crashed.

After scratching my head a bit, I removed the --experimental-scope-hoisting part from the build script in package.json and everything worked again.

So my question is, what does that parameter do? What happens when I leave it away?


That’s an experimental Parcel feature that will try to make your JS bundle smaller. You can read more about it in this blog post.

It worked pretty well for us so far in our tests, but well, it’s experimental. So removing the option is just fine if that makes your plugin work. :slight_smile:

Okay, thank you :slight_smile: