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
dist version is not compiled down to es5 #18
Comments
Here is the official recommendation:
|
Is |
@Rokt33r I am not sure. It uses webpack and Babel underneath. However in this case remark-math only contains three files under its root. So it doesn’t have a separate dist folder. |
@episodeyang The scripts in Btw, if using |
@Rokt33r thanks for your reply! I spend half an hour looking for the answer: here is the relevant bits from web pack's issue. TLDR; module field should use es6 syntax, but it shouldn't contain other ES6 features b/c TypeScript users might have problem. The issue with So the safest way is probably juts to transpire to ES5, point to it in main, and avoid custom webpack config for good. |
Hi! Are there any updates on this? This appears to be breaking my build, UglifyJS seems to choke after I added remark-math to my project. Would love to help out if there's any way for me to do so, because I don't think I can use this otherwise, but it would greatly help my use case. I'm assuming to fix this, we'd have to implement a build script and set up the build/publish commands as they've done in https://github.com/facebook/jest or other libraries? It seems like lerna does not know or care about those parts of the build process, if I understand it correctly. |
Fixed. |
I am running into this problem while using
react-scripts
.When a project uses
remark-math
, if we runreact-scripts build
, CRA tool reports this error:Inspection of the file above shows that this index.js uses a es2015 feature: default value for function parameters. The file looks like this:
I'm not familiar with
lerna
, is it possible to compile the dis version to es5? This has been a recurring theme with a lot of libraries (including my own), and the community tend to end up compiling to es5 in the end.On CRA (Create React App) and
react-scripts
CRA is the way to write react app nowadays, and it doesn't allow custom
webpack.config
so adding whitelisted loading is out of the question (TLDR;).The text was updated successfully, but these errors were encountered: