-
Notifications
You must be signed in to change notification settings - Fork 192
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
Transpile before publish #135
Comments
This has been answered many times over, that's a no. Why aren't you using babel-minify or babili instead of a 2yo tool ? |
Yeah thats my bad, I keep forgetting to check closed issues considering github shows open issues by default. Sorry about that. Heres the issue I duplicated, for the interest of other users #104. (It actually pointed me in the right direction) Im using the electron-react-boilerplate project, which was setup with babel and webpack etc. Im still quite new to JS development so Im not that familiar with all the tools. This project was the dependency of another project which is why I was a bit too quick to open the issue (For some reason, I didn't expect the project to be as popular as it is, and thought it only had two issues). I also ran into this issue with other projects a couple of weeks back, and didn't find a catch all solution. They ended up just transpiling the project. I was also following the release of UglifyJS#harmony, which was supposed to support ES6, but resolve my issue. However I ended up finding the catch-all solution. The webpack config was set to ignore node_modules. The simple solution was to change:
to
With the | operator specifying multiple projects which need transpiled. I initially thought it was some implicit property of transpilers to not touch node_modules, where as it was my build system stating not too. Sorry for the inconvenience. |
Why would you need to transpile it at all using electron, doesn't it already have an almost fully ES6-compliant engine ? |
It does, however UglifyJS doesn't. As soon as I get some spare time, Ill be ripping out the build system and replacing it with a much simpler one. I have a feeling theres a lot of technology being used which is aimed more towards the front-end web than a desktop electron app. i.e. inlining images below a certain size to improve performance etc. However I needed something to get me started quickly and wasn't knowledgeable enough to determine what I did and didn't need. I have a bit more of a clue now. |
I'm not a specialist but I don't think uglify is useful at all in your case since you're not having any network requests. |
Yeah Im of the same mind. Although UglifyJS also obfuscates the code (Although its debatable if its of any real use), and Id hate to remove it now. It will probably get dumped when I get around to rewriting the build script. Thanks, |
This thread has been automatically locked due to inactivity. Please open a new issue for related bugs or questions following the new issue template instructions. |
Would there be an appetite to transpile the codebase using babel before publishing it.
Currently an error is caused by UglifyJS on this library due to its use of ES6 'let'. Which UglifyJS seems to trip over. Its also fairly standard practice to transpile before publishing (or at least all my other dependencies do).
This is ultimately an UglifyJS issue but they seem slow to support ES6, transpiling would solve the issue for now.
The text was updated successfully, but these errors were encountered: