We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
comments: 'all'
Bug report
Version 5.19.4
Complete CLI command or minify() options used
minify()
/** @returns {terser.MinifyOptions} */ const getTerserOpts = () => ({ ecma: 2020, toplevel: true, parse: {}, mangle: true, compress: { keep_fargs: false, pure_getters: true, drop_console: false, pure_funcs: [], unsafe: true, unsafe_arrows: true, unsafe_comps: true, unsafe_Function: true, unsafe_math: true, unsafe_symbols: true, unsafe_methods: true, unsafe_proto: true, passes: 10, }, format: { comments: 'all', wrap_func_args: false, wrap_iife: false, }, }); const file1 = ` // f1-before const func = () => 'surprise!'; // f1-after ` const file2 = ` // f2-before console.log(func()); // f2-after ` const terser = require('terser'); terser.minify({ 'file-1.js': file1, 'file-2.js': file2 }, getTerserOpts()).then(console.dir)
terser input
terser
see above
terser output or error
Expected result
when comments: 'all' is specified, I expect to receive all comments: [f1-before, f1-after, f2-before, f2-after].
[f1-before, f1-after, f2-before, f2-after]
{ code: '// f1-before\n// f1-after\n// f2-before\nconsole.log("surprise!");\n// f2-after' }
(for my use case, I am not too particular about the ordering. but I do care that they are all present)
Actual result even when comments: 'all' is specified, the f1-after comment is missing
f1-after
{ code: '// f1-before\n// f2-before\nconsole.log("surprise!");\n// f2-after' }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Bug report
Version 5.19.4
Complete CLI command or
minify()
options usedterser
inputsee above
terser
output or errorExpected result
when
comments: 'all'
is specified, I expect to receive all comments:[f1-before, f1-after, f2-before, f2-after]
.(for my use case, I am not too particular about the ordering. but I do care that they are all present)
Actual result
even when
comments: 'all'
is specified, thef1-after
comment is missingThe text was updated successfully, but these errors were encountered: