question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Open to an ES5 transpile build step?

See original GitHub issue

If I (or someone) can work out a way to do it would you be open to accepting a PR that has a prepublish step that transpiles the ES6 code to ES5 so that ES5 restrained consumers can also use this module?

E.g. prepublish uses babel to generate output to /lib/es5/ before publish and that’s the entry point for ES5 consumers. This would not impact the ES6 consumers and the current ES6 being used in the module. i.e. ES6 by default. ES5 needs to be explicitly required by the consumer by path.

Might also help with #1 which might need ES5 for browsers.

Issue Analytics

  • State:open
  • Created 7 years ago
  • Reactions:2
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
DavideCarvalhocommented, Nov 23, 2018

I started a branch for this task. I think the best tech for this is rollup, since we can transpile for es5 and es6 at the same time. If someone needs to target only evergreen targets, they can use es6 build (and use stuff like type=module for scripts), otherwise, use es5.

1reaction
sveisveicommented, Jun 17, 2016

Shipping a es5 version should be fine, and is probably needed for a universal version. I am all for it atleast

Read more comments on GitHub >

github_iconTop Results From Across the Web

Author In ES6, Transpile To ES5 As A Build-step - Addy Osmani
Today I used a Grunt task called grunt-traceur by Aaron Frost to author code in ES6 (maximally minimal classes, modules, rest params, spread ......
Read more >
Why don't you add ES5 transpiled code to your modules for ...
One solution would be to automatically check the "engine" field in the package.json of dependencies and decide which dependencies to transpile.
Read more >
Transpiling EcmaScript6 code to ES5 using Babel
Transpiling EcmaScript6 code to ES5 using Babel ... If you open the build/ListView.js file, you will see some calls to require function:.
Read more >
Transpile “debug” and other npm packages to es5 - Medium
Piece of code located in webpack.config.js file. · This is a part of webpack.config.js configuration. · From now on, no more issues with ......
Read more >
Transpiling ES6 to ES5 with Traceur and Babel - Blog
Open the node_modules folder and notice the subfolders that are there now. Step 4: Creating a gulpfile. Now that all of the necessary...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found