32
Wombat
8y

Minifiing js-script in one line...

... Error in Line 1:5363.

Comments
  • 1
    I usually don't compress JS on my dev staging (VM, powered by Vagrant). The compression is only added on prod environement. Not sure what you are using, since you tagged PHP have a look at your framework. For example with Symfonys asset management you can simply add a `?` to the asset filter to not use it on dev environement!
  • 1
    @pascalwacker thanks for the advice.
    Actually I am including js-files in one php file and buffer output, those containing different functions I use an some pages. I compress the ouput by regex and print it in the requested file.

    Actually its no problem for me to comment that line out. But when that happens and I look into the console it makes me grrr... ^^
  • 2
    @Divisionbyzero I usually use https://github.com/mishoo/UglifyJS with my projects (there's also a version for CSS). I don't really see the value you get by writing another minifyer plus it's easy to make a mistake or compress something the wrong way (assuming you also rename variables/uglify in the process)
  • 2
    @pascalwacker I heard this 'why invent the qheel twice' speech, but all I do is for learning.
  • 1
    @Divisionbyzero then it's absolutely legit! That's the right spirit! Good luck with it (:
  • 1
    @pascalwacker thank you :)
  • 2
    @pascalwacker
    UglifyJS Version 1 is a bit outdated ;-)

    Link to Version 2:
    https://github.com/mishoo/UglifyJS2
  • 0
    @thoxx true my bad.
Add Comment