Comments (8)
@coryshaw as you're already using webpack, you can just configure it to transpile this module to es5. Use babel-loader
and limit it to transpiling only this module either with include
or test
(test: /node_modules\/parse-usdl\/.*?\.js$/
)
from parse-usdl.
@mvayngrib I had some trouble getting the transpile to work. Should the parse-usdl library do the transpiling itself?
from parse-usdl.
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).
from parse-usdl.
@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 webpack
and babel-preset-env
to create the bundle that works in their particular environment.
from parse-usdl.
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).
from parse-usdl.
@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
from parse-usdl.
i made a small example for you: https://github.com/mvayngrib/usdl-example
run: npm run build
open index.html (it will log a parsed usdl license to the console)
fiddle around with browser support in babel.config.js to see the differently transpiled code
edit: poking around, i see that usdl-example is not set up the ideal way. Webpack can invoke babel directly, see babel-loader
from parse-usdl.
Okay. Will have to get back to you on this. Thanks.
from parse-usdl.
Related Issues (7)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from parse-usdl.