bug: `stencil build` command generates the folder `dist\esm\polyfills\` folder even if buildEs5=false in config
Prerequisites
- [X] I have read the Contributing Guidelines.
- [X] I agree to follow the Code of Conduct.
- [X] I have searched for existing issues that already report this problem, without success.
Stencil Version
4.12.4
Current Behavior
Even if set the flag buildEs5: false in stencil.config.ts the output in dist is generating the es5 files:
In my company they are finding vulnerabilities in this files that we don't even use 😢
Expected Behavior
It is possible not to generate these files that are not being used by the component?
System Info
System: node 18.16.0
Platform: windows (10.0.22621)
CPU Model: 13th Gen Intel(R) Core(TM) i5-1345U (12 cpus)
Compiler: C:\Projects\web-components\axa.be.webcomponent.abe-dropdown\node_modules\@stencil\core\compiler\stencil.js
Build: 1707755243
Stencil: 4.12.2
TypeScript: 5.3.3
Rollup: 2.56.3
Parse5: 7.1.2
jQuery: 4.0.0-pre
Terser: 5.27.0
Steps to Reproduce
- Generate a new Stencil Component
- Configure the
stencil.config.tswith the flagbuildEs5: false - Execute
npm run build
Code Reproduction URL
https://github.com/alvarocjunq/stencil-es5-polyfill-issue
Additional Information
No response
Hey @alvarocjunq 👋
Thanks for the issue! It appears the logic that we currently use to generate these files doesn't take any Stencil configuration values into account, which is why you likely see these files generated as a part of the build. I'm going to label this for someone to take a look into some ways we can fix this.
Thank you to take into account @rwaskiewicz 😄
The fix for this issue has been released as a part of today's Stencil v4.18.1 release!