-
Notifications
You must be signed in to change notification settings - Fork 628
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
Bundle output is ES2020 not ES2015 #7759
Comments
closes vega#7759
We have both bundles for the browser and compiled files for bundlers in our NPM package. The latter is what you should use for web pack and it's ES2015. The bundles are made for browsers that support modern features. Can you change what file your bundler uses? |
@domoritz Could you clarify which bundle is for the browser vs for server-side/bundlers? I'm looking at
I can't seem to find another bundle at all. (I do see the transformed code I might be able to change which file the bundler uses although I'm using Next.JS environment so it would require diving a level down into Webpack configs. I think if you use the Thanks for your help! |
Yes, we don't have bundles for bundlers but instead separate files that use imports ( Line 16 in 11d70ba
module entry.
|
@domoritz I'm encountering similar errors as @alexkreidler above. What would I need to set in my webpack config and/or babel loader to point to the compiled files ( |
Every webpack and babel setup is different and I don't know webpack well. I won't be able to help without significant time investment. |
Understood. Am I correct in that I want my webpack configured such that for the vega-lite module, it is using an ES5-compliant target (e.g., |
You need to make sure your tool chain is up to date enough to handle modern js. Then you can leave the sources as is and output whatever version you need. Also, the web is way beyond es5 at this point so I don't think you even need to output es5. |
I've installed vega-lite 5.1.1, but I'm getting the following error from Babel/webpack because of nullish coalescing operators in the
vega-lite.js
bundle:It seems to be the same issue as #7595 (comment).
I think the problem is because #7595 only changed the
tsconfig.json
target
, which AFAIK is not read by Babel, which is used to build the bundle, so it's exactly the same as before.A solution would be just to get rid of the
@babel/preset-env
targets the following in the Rollup config. This would make Babel emit ES5 by default. BTW@babel/preset-env
and@babel/env
, which is used in the code, are the same; it could be helpful to use the more widely-recognized name.vega-lite/rollup.config.js
Lines 72 to 74 in 226754f
Thanks for this great library!
The text was updated successfully, but these errors were encountered: