Uglify-JS Error: Unexpected character '' when concatenated and then minifying select2

I am attaching select2 to my other javascript files, for example:

cat scripts/jquery-timeago.js scripts/jquery-autosize.js scripts/select2.js > public/vendors.js
uglifyjs -nc -o public/vendors.min.js public/vendors.js

However, I found a problem where before there select2would be an empty space character before select2only after concatenation, which then causes a parsing error in UglifyJS. If I go to the beginning, where it select2starts in the combined file and presses backspace, the empty character is deleted and minimization works fine.

What's happening? How can i fix this?

+5
source share
2 answers

Just open question # 306 about this in select2 github repo.

select2.js UTF8 BOM. select2.js uglifyjs, uglifyjs , .

, UTF8 ( ).

+7

, . .

uglify : ascii_only quote_keys. true.

+1

All Articles