Issue with building for IE11 #12283
-
I have recently upgraded my yarn dependencies which also involved upgrading to Storybook 6. However I noticed the built JS no longer works for IE11. It seems that it no longer transpiles arrow functions. I run my build script which does: I then try to verify if my built JS file works for ES5 using es-check: However I get an error:
When I check line 2, position 2 in the Part of the
Here's my
And the contents of the entry
EDIT: |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
Added a minimal project setup: https://github.com/dan2k3k4/es5-minimal-project |
Beta Was this translation helpful? Give feedback.
-
And it worked. I believe there must be configuration in webpack to turn off arrow functions in webpack's runtime code, but I haven't had time to explore it. EDIT:: |
Beta Was this translation helpful? Give feedback.
First of all, I ran this command to figure out which of your dependencies publish ES6.
npx are-you-es5 check ./
Then in webpack configuration on line no 18, I modified the
exclude
option to stop excluding the packages which publish ES6.exclude: [/node_modules\/(?!(twig|twig-drupal-filters|lit-html|lit-element)\/).*/],
Still there were arrow functions in the
dist/scripts.js
. Upon some research, I found out that it was webpack's boilerplate code, which contains the arrow functions. So I downgraded the webpack to version4.41.5
[lastest previous major version I found].And it worked. I believe there must be configuration in webpack to turn off arrow functions in webpack's runtime co…