While building my react which requires es5 varitant, using buildEs5: 'prod', the build using uglifyjs-webpack-plugin breaks with the below error
In strict mode code, functions can only be declared at top level or immediately within another function.
Stencil version:
@stencil/[email protected]
I'm submitting a:
[x] bug report
Current behavior:
The es5 variation of stencil core build references the polyfill file which causes a build system for es5 to break dues to strict mode configurations
Expected behavior:
The app in which the stencil is integrated should build fine after including stencil.
Other information:
After some digging around, this is caused by checkIfURLIsSupported() in the polyfills/index.js file. This can be fixed by converting checkIfURLIsSupported as a function expression. I am happy to put a PR if this can be a fix that solves the issue without hurting any other setup.
That sounds like a good fix. Looking forward to the PR 馃槃
Thanks, its up here @claviska
Thanks, fixed in #2799.