You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Basically when I build the addon code with rollup I can see the addon code is using a lot of modern features like static blocks, private fields etc., but when I inspect the bundle for the addon generated by the main apps build it seems that all that stuff gets transpiled away (even though our browser targets are all latest browsers that should support such syntax)
After some digging around I noticed that these plugins seem to run always, and they are the root cause of this transpilation.
It would be nice if we had an option to not include any of these if we want, like for ember-cli-babel we have the disableDecoratorTransforms option.
I left my-app/dist and my-app/dist-when-i-manually-remove-plugins-from-node-modules-ember-auto-import commited on purpose so you can see the difference w/o having to do a build.
For my-app/dist I just ran production build w/o changing anything, but for my-app/dist-when-i-manually-remove-plugins-from-node-modules-ember-auto-import I ran production build while manually removing those plugins from node_modules/ember-auto-import
The text was updated successfully, but these errors were encountered:
ember-auto-import's standard babel config still needs some decorator support. The app's babel config does not apply to auto-imported dependencies. So I think the option you'd want to add is one that would switch ember-auto-import to use decorator-transforms instead of @babel/plugin-proposal-decorators.
I think it would need to be an option because if we made it the default it would be a breaking change to our supported browsers.
We started using https://github.com/ef4/decorator-transforms to build our v2 Ember addons.
But when we actually use this addons in our application I noticed some transpilations were happening that shouldn't be there.
Basically when I build the addon code with rollup I can see the addon code is using a lot of modern features like static blocks, private fields etc., but when I inspect the bundle for the addon generated by the main apps build it seems that all that stuff gets transpiled away (even though our browser targets are all latest browsers that should support such syntax)
After some digging around I noticed that these plugins seem to run always, and they are the root cause of this transpilation.
It would be nice if we had an option to not include any of these if we want, like for
ember-cli-babel
we have thedisableDecoratorTransforms
option.Here is a repo with reproduction (See chunk.143 in dists)
https://github.com/vstefanovic97/ember-auto-import-decorator-transpilation-example
I left
my-app/dist
andmy-app/dist-when-i-manually-remove-plugins-from-node-modules-ember-auto-import
commited on purpose so you can see the difference w/o having to do a build.For
my-app/dist
I just ran production build w/o changing anything, but formy-app/dist-when-i-manually-remove-plugins-from-node-modules-ember-auto-import
I ran production build while manually removing those plugins fromnode_modules/ember-auto-import
The text was updated successfully, but these errors were encountered: