-
Notifications
You must be signed in to change notification settings - Fork 30
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
ES6 code is not bundle safe #1
Comments
@coryshaw as you're already using webpack, you can just configure it to transpile this module to es5. Use |
mvayngrib#1 Signed-off-by: Nathan Youngman <[email protected]>
@mvayngrib I had some trouble getting the transpile to work. Should the parse-usdl library do the transpiling itself? |
I'm not sure what it takes to get the library to transpile and work with projects that may not even use babel. For such a small library, my current solution for IE11 support is to remove the ES6 (from a fork). |
@nathany the problem with transpilation in-library is we don't know who our users are. IE11 users will want it transpiled a different way from people using chrome. I think it's better to delegate this decision to the consumer of this library, who will use some combination of |
I'm not sure if there is a precedent from other libraries, but this is my first time running into this issue. If the transpiled code isn't included, perhaps the solution is to provide better documentation in the README. As of yet, I haven't been able to get the transpiling working so that this library works in Internet Explorer 11 (yes, I know, why do we need to support IE 11 anyway, but we do). |
@nathany maybe I can help. What are you using to transpile the rest of your code? Babel with babel-preset-env + webpack is the standard these days, and they support transpiling per browser (including ie 11). Take a look at https://babeljs.io/docs/en/next/babel-preset-env.html |
i made a small example for you: https://github.com/mvayngrib/usdl-example run: edit: poking around, i see that usdl-example is not set up the ideal way. Webpack can invoke babel directly, see babel-loader |
Okay. Will have to get back to you on this. Thanks. |
Hello, This is a nice little utility! We noticed that it uses
let
andconst
(ES6) and is breaking our webpack build due to the fact that Uglify JS cannot minify ES6 code. Super easy to fork into our own function but just wanted to give a heads up. Thanks!The text was updated successfully, but these errors were encountered: