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

Don't transpile to ES5 #772

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

vincentfretin
Copy link
Contributor

We used @babel/preset-env without browserlist config in package.json, so @babel/preset-env defaulted to ES5 and not browserlist defaults query that applies modern browsers. See doc
https://babeljs.io/docs/babel-preset-env
https://babeljs.io/docs/options#no-targets
but really nowadays we don't need to transpile to ES5, that was at a time we needed to support IE11.
We don't use any fancy javascript syntax here, only ES6/ES2015 that is supported by all supported browsers.

Bundle size reduced from 521K to 426K. Transpiling to ES5 included lots of polyfills we don't need.

@vincentfretin
Copy link
Contributor Author

I just had the idea to do this PR while watching https://www.youtube.com/watch?v=odhjF1obcUo

@vincentfretin
Copy link
Contributor Author

To use it:

<a-scene inspector="url: https://cdn.jsdelivr.net/gh/aframevr/aframe-inspector@ddda46f4376cf696e623721d98e1c2eb3e799b73/dist/aframe-inspector.min.js">

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

Successfully merging this pull request may close these issues.

1 participant