Closed frankrue closed 6 years ago
@flitbit would it be possible to merge this ? It is causing uglifyJS to throw an error during uglification as it only supports pure es5.
yarn run build
for a project based on create-react-app
fails due to the same reason, I suppose:
yarn run v1.3.2
$ react-scripts build
Creating an optimized production build...
Failed to compile.
Failed to minify the code from this file:
./node_modules/json-ptr/index.js:208
Read more here: http://bit.ly/2tRViJ9
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
As an alternative to this PR, fork of @danfo contains a possible solution in the build-es5-lib branch, see commit https://github.com/danfo/json-ptr/commit/33b5c09bfb21c74c59e5c514162fd0b224a46600
Edit: PR is incomplete because ES2015-keywords like class
are still there. Instead of manually converting all ES2015-specific code (and then being restricted to the old syntax) I would prefer solution of @danfo.
I'm pretty sure this is no longer an issue; I've gone back to ES5 by default since there wasn't enough reasons for the compatibility hassles of ES6+ in such a small module. Let me know.
This merge would remove ES2015-specific code, which was causing iOS Safari to error on the use of the "use strict" command with
let
keywords and the()=>
form of a function definition.