Is it possible to disable the added module wrapping code? I.e:
parcelRequire = (function (modules, cache, entry, globalName) { [...]
And instead encapsulate the output in a simple IIFE? I.e:
(function() {
})();
I'm trying to convert a .vue file to vanilla js to be used as a Vue component in the backend for a specific CMS. Parcel is able to convert the .vue-file to js and I am able to use the component in my CMS. But, looking at the js output, there is over 1 kB of wrapper code.
In my case, my Vue component does not need to be imported by the CMS. The CMS is built in a way that custom plugins/fields needs to add themself to the plugin registry.
Therefore this module bundling wrapper code is unnecessary in this case and only adds a lot of overhead to the plugins. A better solution would be an option to let Parcel wrap the output in a simple IIFE to encapsulate it.
| Software | Version(s) |
| ---------------- | ---------- |
| Parcel | 1.10.3
| Node | 10.13.0
| npmn | 6.4.1
| Operating System | macOS 10.14.1
Just found out about the --experimental-scope-hoisting setting that seems to do what I want.
Feel free to close this issue if you haven't got something else to add.
Most helpful comment
Just found out about the
--experimental-scope-hoistingsetting that seems to do what I want.Feel free to close this issue if you haven't got something else to add.