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

Compile package to es5 #68

Open
tsjohns9 opened this issue Jun 5, 2019 · 3 comments
Open

Compile package to es5 #68

tsjohns9 opened this issue Jun 5, 2019 · 3 comments

Comments

@tsjohns9
Copy link

tsjohns9 commented Jun 5, 2019

This package, as well as node-drange are not transpiled to es5, and it makes cross-browser support difficult. This module is part of my dependency tree and broke ie11 support due to the use of es6 features. It would be nice if this could be distributed so that it has more cross-browser support

@fent
Copy link
Owner

fent commented Jun 6, 2019

Are you using a package bundler? If so, which one?

My understanding is that in the future, bundlers will handle transpiling, letting library authors focus only on the library, and not on how to export the library. I don't even think that I should include a minified version, since that's one of the first things bundler's handle. This is actually one of the only projects that includes a minified browserified version.

@tsjohns9
Copy link
Author

tsjohns9 commented Jun 6, 2019

Yes, I am using webpack. What we have been doing is excluding all node_modules from running through babel-loader. To work around this I had to identify the packages that were not already transpiled to es5, and then have webpack run those through babel-loader. This is fine for now, but I can't image this is how other projects handle dependencies that are not already transpiled to es5. If we ever add a new package, and somewhere in the dependency tree there is a module that is not already transpiled we will have to identify that and add include it in webpack.

@ryoppippi
Copy link

ryoppippi commented Jun 7, 2024

Hi
This is bun's bag, but if you compile randexp.js to es5 or just use named exports, it solves

1 ❱ bun run index.ts
1 | (function (entry, fetcher)
    ^
SyntaxError: Missing 'default' export in module './node_modules/randexp/lib/randexp.js'.

This is related to this issue oven-sh/bun#7465

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

No branches or pull requests

3 participants