minifier icon indicating copy to clipboard operation
minifier copied to clipboard

Minifier resolves \unnnn and \xnn to characters and breaks the file

Open Gachl opened this issue 9 years ago • 1 comments

`> npm install minifier /home/gachl └── [email protected]

npm WARN enoent ENOENT: no such file or directory, open '/home/gachl/package.json' npm WARN gachl No description npm WARN gachl No repository field. npm WARN gachl No README data npm WARN gachl No license field.

echo 'alert("\u00A9");' >> test.js

npm bin/minify test.js Minification complete

cat test.min.js alert("©")`

test.min.js should still contain the literal "\u00A9" and not the resolved character ©, at least all my scripts break horribly because it doesn't. Is there any way to have it keep the escaped characters?

Gachl avatar Jul 26 '16 11:07 Gachl

This is an issue in https://github.com/mishoo/UglifyJS2, as I get the same result with npm i uglifyjs; echo 'alert("\u00A9")' | node_modules/.bin/uglifyjs.

Can you create a similar issue over there?

fizker avatar Jul 26 '16 11:07 fizker