Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
3 tasks done
alvarocjunq opened this issue Feb 27, 2024 · 3 comments · Fixed by #5725
Closed
3 tasks done
Labels
Bug: Validated This PR or Issue is verified to be a bug within Stencil

Comments

@alvarocjunq
Copy link

alvarocjunq commented Feb 27, 2024

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

@ionitron-bot ionitron-bot bot added the triage label Feb 27, 2024
@rwaskiewicz rwaskiewicz self-assigned this Feb 27, 2024
@rwaskiewicz
Copy link
Member

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 rwaskiewicz added Bug: Validated This PR or Issue is verified to be a bug within Stencil and removed triage labels Feb 27, 2024
@rwaskiewicz rwaskiewicz removed their assignment Feb 27, 2024
@alvarocjunq
Copy link
Author

Thank you to take into account @rwaskiewicz 😄

alicewriteswrongs added a commit that referenced this issue May 2, 2024
Prior to this change Stencil will copy polyfills to the `dist` output
target whether or not the user has indicated they'll be necessary.

The polyfills comprise two things: copying the polyfills themselves into
the 'loader' path, and adding code to the lazy-loader entry points which
loads those polyfills. Instead of just assuming that the user wants
this, we now gate this behavior on whether `buildEs5` is set on the
Stencil configuration.

fixes #5416
STENCIL-1288
alicewriteswrongs added a commit that referenced this issue May 2, 2024
Prior to this change Stencil will copy polyfills to the `dist` output
target whether or not the user has indicated they'll be necessary.

The polyfills comprise two things: copying the polyfills themselves into
the 'loader' path, and adding code to the lazy-loader entry points which
loads those polyfills. Instead of just assuming that the user wants
this, we now gate this behavior on whether `buildEs5` is set on the
Stencil configuration.

fixes #5416
STENCIL-1288
alicewriteswrongs added a commit that referenced this issue May 2, 2024
Prior to this change Stencil will copy polyfills to the `dist` output
target whether or not the user has indicated they'll be necessary.

The polyfills comprise two things: copying the polyfills themselves into
the 'loader' path, and adding code to the lazy-loader entry points which
loads those polyfills. Instead of just assuming that the user wants
this, we now gate this behavior on whether `buildEs5` is set on the
Stencil configuration.

fixes #5416
STENCIL-1288
alicewriteswrongs added a commit that referenced this issue May 2, 2024
Prior to this change Stencil will copy polyfills to the `dist` output
target whether or not the user has indicated they'll be necessary.

The polyfills comprise two things: copying the polyfills themselves into
the 'loader' path, and adding code to the lazy-loader entry points which
loads those polyfills. Instead of just assuming that the user wants
this, we now gate this behavior on whether `buildEs5` is set on the
Stencil configuration.

fixes #5416
STENCIL-1288
alicewriteswrongs added a commit that referenced this issue May 3, 2024
Prior to this change Stencil will copy polyfills to the `dist` output
target whether or not the user has indicated they'll be necessary.

The polyfills comprise two things: copying the polyfills themselves into
the 'loader' path, and adding code to the lazy-loader entry points which
loads those polyfills. Instead of just assuming that the user wants
this, we now gate this behavior on whether `buildEs5` is set on the
Stencil configuration.

fixes #5416
STENCIL-1288
alicewriteswrongs added a commit that referenced this issue May 7, 2024
Prior to this change Stencil will copy polyfills to the `dist` output
target whether or not the user has indicated they'll be necessary.

The polyfills comprise two things: copying the polyfills themselves into
the 'loader' path, and adding code to the lazy-loader entry points which
loads those polyfills. Instead of just assuming that the user wants
this, we now gate this behavior on whether `buildEs5` is set on the
Stencil configuration.

fixes #5416
STENCIL-1288
github-merge-queue bot pushed a commit that referenced this issue May 7, 2024
#5725)

Prior to this change Stencil will copy polyfills to the `dist` output
target whether or not the user has indicated they'll be necessary.

The polyfills comprise two things: copying the polyfills themselves into
the 'loader' path, and adding code to the lazy-loader entry points which
loads those polyfills. Instead of just assuming that the user wants
this, we now gate this behavior on whether `buildEs5` is set on the
Stencil configuration.

fixes #5416
STENCIL-1288
@alicewriteswrongs
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug: Validated This PR or Issue is verified to be a bug within Stencil
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants