Closed csisy closed 4 months ago
Thanks @csisy, I was able to confirm this behavior described in issue summary.
I'm going to label this to get it into our backlog for the team to take a look
Hi @rwaskiewicz 👋,
Is there any news regarding this issue? With more and more browser support, having all this legacy code is a bit unnecessary.
Thank you for all the great work 🚀
@Tragio
Is there any news regarding this issue? With more and more browser support, having all this legacy code is a bit unnecessary.
This effort is up for consideration for Stencil v5. I don't have a timeline for this version of Stencil ATM, other than I'm quite literally doing the planning work as we speak.
Thank you for all the great work 🚀
❤️
Related: https://github.com/ionic-team/stencil/issues/5416 (potentially the same)
The fix for this issue has been released as a part of Stencil v4.18.1 release!
Prerequisites
Stencil Version
2.19.2
Current Behavior
Despite explicitly turning off ES5 build, there is no way to let the compiler know that we are trying to target a modern browser that doesn't need (for example) nomodule js files.
Targeting
www
, a very basic single-component library/app generates 5 files in prod mode and 9 files in dev mode. The dev build contains additional unnecessary files, likecss-shim
andshadow-css
. No matter what I set in the config file.Files generated in
dev
mode underwww/build
:In
prod
mode, the polyfill/shim files are not present, fortunately.Lastly, executing a dev build then a prod build generates one additional unnecessary file that is not generated in a second prod build. So build dev > build prod (+1 file for a total of 6 files) > build prod (5 files)
Expected Behavior
Either provide a config option to completely disable any kind of legacy support, or better examine the project files.
For example, despite the
nomodule
script tag is removed from theindex.html
, the unnecessarymy-app.js
file and an emptyindex.js
is generated. By better examining the root html file, the compiler could find out that nonomodule
file is needed.The unnecessary shim and other polyfill files should not be generated when not needed.
Lastly, the 1 extra file on the first prod build must not be created.
Steps to Reproduce
Follow the getting started documentation.
npm init stencil
component
npm install
npm run build
www/build
directoryCode Reproduction URL
-
Additional Information
No response