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

v2.4.4 no longer transpiles to pure ECMAScript 5 #158

Closed
vvanpo opened this issue Apr 29, 2021 · 1 comment
Closed

v2.4.4 no longer transpiles to pure ECMAScript 5 #158

vvanpo opened this issue Apr 29, 2021 · 1 comment
Labels

Comments

@vvanpo
Copy link

vvanpo commented Apr 29, 2021

In my project I use es-check to verify that my bundles are properly transpiled down to ES5, as I don't run all node_modules dependencies through Babel. After upgrading from 2.4.3 to 2.4.4, this check failed.

Example:

$ cd /tmp
$ npm i css-vars-ponyfill@2.4.3
$ npx es-check es5 node_modules/css-vars-ponyfill/dist/css-vars-ponyfill.min.js
ES-Check: there were no ES version matching errors!  🎉 
$ npm i css-vars-ponyfill@2.4.4
$ npx es-check es5 node_modules/css-vars-ponyfill/dist/css-vars-ponyfill.min.js
ES-Check: there were 1 ES version matching errors.

          ES-Check Error:
          ----
          · erroring file: node_modules/css-vars-ponyfill/dist/css-vars-ponyfill.min.js
          · error: SyntaxError: The keyword 'const' is reserved (8:5130)
          · see the printed err.stack below for context
          ----

          SyntaxError: The keyword 'const' is reserved (8:5130)

I assume that the dist/css-vars-ponyfill.min.js is intended to be referenced by a <script> tag within IE9, so I would expect the bundle to pass all ES5 checks.

@jhildenbiddle
Copy link
Owner

jhildenbiddle commented Apr 30, 2021

Thanks, @vvanpo. Fixed in 2.4.5.

FWIW, the issue was caused by upgrading balanced-match to v2.0.0. The new version does not contain a pre-built ES5 distributable, and my babel configuration is set to exclude files in /node_modules/. The end result was balanced-match v2.0.0 was being included as-is (i.e., no transpilation).

I have added es-check to the build process to prevent this from happening in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants