sindresorhus / multiline

Multiline strings in JavaScript

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

UglifyJS2 comments are not preserved

gaborbernat opened this issue · comments

:) Any ideas?

Did you read the readme?

Sure, but adding either @preserve or /!* is stripped, I found multiple uglifyjs2 tickets related to this: mishoo/UglifyJS#88

Tests are passing with latest UglifyJS2, so you're probably doing something wrong:

multiline/test.js

Lines 72 to 84 in 15fb096

it('should be preserved when using Uglify', function () {
var uglify = require('uglify-js');
var fixture = 'var str=multiline(function(){/*!@preserve\n<!doctype html>\n*/\nconsole.log});';
var actual = uglify.minify(fixture, {
fromString: true,
output: {
comments: true
}
}).code;
assert.equal(actual, fixture);
});

Make sure you've read everything here: https://github.com/sindresorhus/multiline#minification

@gaborbernat, could you share your code?

I'll try to make a demo of this next week as the actual source code is
trade mark :)
On Mar 12, 2015 9:16 PM, "Kevin Mårtensson" notifications@github.com
wrote:

@gaborbernat https://github.com/gaborbernat, could you share your code?


Reply to this email directly or view it on GitHub
#28 (comment)
.

@gaborbernat Even better, submit a failing test if possible ;)

Oh, you're right, I'll try it :)
On Mar 13, 2015 5:17 PM, "Sindre Sorhus" notifications@github.com wrote:

@gaborbernat https://github.com/gaborbernat Even better, submit a
failing test if possible ;)


Reply to this email directly or view it on GitHub
#28 (comment)
.