stencil icon indicating copy to clipboard operation
stencil copied to clipboard

bug: `stencil build` command generates the folder `dist\esm\polyfills\` folder even if buildEs5=false in config

Open alvarocjunq opened this issue 1 year ago • 2 comments

Prerequisites

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:

image

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

  1. Generate a new Stencil Component
  2. Configure the stencil.config.ts with the flag buildEs5: false
  3. Execute npm run build

Code Reproduction URL

https://github.com/alvarocjunq/stencil-es5-polyfill-issue

Additional Information

No response

alvarocjunq avatar Feb 27 '24 11:02 alvarocjunq

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.

rwaskiewicz avatar Feb 27 '24 13:02 rwaskiewicz

Thank you to take into account @rwaskiewicz 😄

alvarocjunq avatar Feb 27 '24 15:02 alvarocjunq

The fix for this issue has been released as a part of today's Stencil v4.18.1 release!

alicewriteswrongs avatar May 13 '24 19:05 alicewriteswrongs