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

Run client-side JS through Babel #206

Open
raphinesse opened this issue Jul 18, 2019 · 4 comments
Open

Run client-side JS through Babel #206

raphinesse opened this issue Jul 18, 2019 · 4 comments

Comments

@raphinesse
Copy link
Contributor

raphinesse commented Jul 18, 2019

Feature Request

Motivation Behind Feature

This would allow us to just set the environments we want to support in the Babel config and stop worrying about which JS features are supported by which version of which WebView.

Feature Description

As we have a build step anyways, so we would just have to add Babel to the build process.

The only real drawback I can see is that our generated cordova.js might not be as readable as before. But I'd be OK with that.

Real-life examples where not having this bit me: #203 #204

@erisu
Copy link
Member

erisu commented Jul 18, 2019

I am also in favor of this idea. 👍

@raphinesse
Copy link
Contributor Author

I already have a running proof-of-concept. Will create a PR as soon as I find the time.

@breautek
Copy link

If readability is a concern, we can also include source maps so that line numbers and stacktraces at least trace back to the original source file, which the web inspectors also supports and will display.

Not sure if the babel tool itself supports source maps cause I've always use babel in conjunction with another bundler like webpack.

@erisu
Copy link
Member

erisu commented Oct 11, 2019

It supports source maps: https://babeljs.io/docs/en/options#sourcemaps

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

Successfully merging a pull request may close this issue.

3 participants