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

change let to var in function AMTgetTeXsymbol #2

Merged
merged 1 commit into from
Apr 9, 2017
Merged

change let to var in function AMTgetTeXsymbol #2

merged 1 commit into from
Apr 9, 2017

Conversation

beeplin
Copy link
Contributor

@beeplin beeplin commented Apr 9, 2017

sometimes the ES6 let causes error during webpack building. Changing it to var solves this problem.

@tylerlong
Copy link
Owner

tylerlong commented Apr 9, 2017

Show me how to produce the error. (Are your running a very ancient version of Node.js?)

I prefer ES6 syntax unless there is a good reason to stick to ES5.

@beeplin
Copy link
Contributor Author

beeplin commented Apr 9, 2017

I am using the latest nodejs v7 and webpack v2. I got the error when doing 'npm run build' -- uglifyJs does not recognize 'let'. Normally babel runs before uglifyJs and converts 'let' to 'var', but in many cases people config webpack not to run babel for files in 'node_modules' in order to save some packing time, so the js file with 'let' was passed to uglifyJs directly. 'npm run dev' works fine since it does not call uglifyJs.

It is wonderful to write source code in es6 but when publishing a node package it is recommended to convert es6 in src to es5 in dist yo avoiding the issue mentioned above.

@tylerlong
Copy link
Owner

Fair enough.

I will release a new version soon.

@tylerlong tylerlong merged commit d0cb6fd into tylerlong:master Apr 9, 2017
@tylerlong
Copy link
Owner

Released version 0.3.2 to npm

@beeplin
Copy link
Contributor Author

beeplin commented Apr 9, 2017

:)

BTW how about exporting newsymbol and newcommand functions just like the orignal ASCIIMathML.js? It is quite uaeful to cumstomize new commands.

@tylerlong
Copy link
Owner

I don't use them myself. So I have no idea what are they.

Feel free to submit PRs. Don't forget to provide usage sample in README.md

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

Successfully merging this pull request may close these issues.

2 participants