-
Notifications
You must be signed in to change notification settings - Fork 299
UglifyJS #611
Comments
I did some work on this, providing a prepublish routine for npm at atfornes@bd3a68e. Please, let us know if it helped |
@atfornes Can you make a PR and ask the maintainers to republish the package with the pre-compiled code? |
@atfornes Could I simply add prepublish in node_modules/ipfs-api/package.json file? |
@povi add |
@GoodBoy962, @adrianmcli, I am going to have a look into this today, hopefully sharing a useful pull request. |
@GoodBoy962 @adrianmcli, please let me know if the pull request #630 solves your issues. |
@atfornes Thanks! Waiting for pr confirmation |
Hi all! For a time, we published all of our dependencies transpiled for a while and then we decided to revert back. The reasons where the following:
The reality at the time was that there was no uglifyJS with ES6 support, but today (roughly started 6 months ago) there is indeed uglifyJS with ES6 support and we use it for our dist version. You can use that version by requiring the module as What I would like to see is create-react-app to upgrade to the latest uglifyJS. Asking the entire world to publish ES5 code -- https://github.com/facebookincubator/create-react-app/blob/master/packages/react-scripts/template/README.md#npm-run-build-fails-to-minify -- specially when pretty much the only thing we do is Arrow Functions. Let me enphasize that there is an update uglifyJS that does indeed support ES6 |
Related, @hacdias hit the same issue using hjs-webpack and here is how he solved it: |
thanks @diasdavid, The only issue that remains for me is that the |
@diasdavid |
@GoodBoy962, using my pull request you could include |
Uglify may support minifying ES6, but the code will then not run in IE 9 (syntactically). |
@atfornes which file should i change in node_modules? |
@GoodBoy962, I would not manually change any file in the node_modules, but instead install the modified branch with: |
@atfornes I have got such a stack trace: WARN registry Unexpected warning for https://registry.npmjs.org/: Miscellaneous Warning EINTEGRITY: sha512-q4spe4KTfsAS1SUHLO0wz8Qiyf1+vMIAgpRYioFYDMNqKfHQbg+AVDH3i4fvpl71/P1L0dBl+fQi+P37UYf0ew== integrity checksum failed when using sha512: wanted sha512-q4spe4KTfsAS1SUHLO0wz8Qiyf1+vMIAgpRYioFYDMNqKfHQbg+AVDH3i4fvpl71/P1L0dBl+fQi+P37UYf0ew== but got sha1-Yi4y6CSItJJ5EUpPns9F581rulU=. (6052 bytes) npm ERR! Cannot read property '0' of undefined npm ERR! A complete log of this run can be found in: |
@GoodBoy962 please try a clean npm install, previously removing node_module folder and package-lock.json file. I have installed it with the same instruction without problems. this issue gives more details about those WARNINGS npm/npm#16861 |
@atfornes thanks! That helped me to install your custom dependency. |
@GoodBoy962, can you share what is the content of that line in that file? In my instalation is can you also share what is the error message? |
@atfornes Here is the whole file. My 7th line is different const getConfig = require('./default-config'); module.exports = arg => { if (typeof arg === 'function') { |
@GoodBoy962, It is weird that a file in lib folder is not transpiled... (does not have arrow functions, for instance). I am sorry I cannot continue following this issue, please try again to do a clean npm install and check that babel (the transpiler that transforms original code in src/ to transpiled code in lib/) process is run. Please let us know if you found how to fix that issue. |
@atfornes are you sure that after installing your custom solution I should have a file which is not the same as I published here? |
you are right @GoodBoy962, I missed the babel config file, which is fixed now by a1504c6. Please try again now. |
@atfornes That helped! Thank you a lot! |
@GoodBoy962, you can propose a similar PR for that module then. Please let us know when it is ready. |
Hey I'm getting a : when trying to use your fix, I tried clean installing and all.. Hopefully you can help me fix this ! |
Any changes for that bug? |
We now compile dependencies starting in |
Check ipfs/js-ipfs#1321 for more info. |
…#15) * adding web3 1.0 as dep and removing truffle-contract. Adding npm version of linnia-js * update package-lock.json * adding config file * update config.yml * fixing scrypt test error and cleaning up tests * udpating dotenv * remove uglyfy until this is fixed ipfs-inactive/js-ipfs-http-client#611
Running
npm run build
results in error:when trying to build a react.js project that has ipfs-api as a dependency.
As suggested by https://github.com/facebookincubator/create-react-app/blob/master/packages/react-scripts/template/README.md#npm-run-build-fails-to-minify , the project should be published pre-compiled.
The text was updated successfully, but these errors were encountered: