mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
Add 'inline' to UglifyJS source map content (#45904)
This commit is contained in:
parent
491f394a3e
commit
f25da746d2
2
types/uglify-js/index.d.ts
vendored
2
types/uglify-js/index.d.ts
vendored
@ -433,7 +433,7 @@ export interface SourceMapOptions {
|
||||
names?: boolean;
|
||||
url?: string | 'inline';
|
||||
root?: string;
|
||||
content?: RawSourceMap;
|
||||
content?: RawSourceMap | 'inline';
|
||||
}
|
||||
|
||||
export function minify(files: string | string[] | { [file: string]: string }, options?: MinifyOptions): MinifyOutput;
|
||||
|
||||
@ -11,7 +11,7 @@ code = {
|
||||
|
||||
minify(code);
|
||||
|
||||
code = "function add(first, second) { return first + second; }";
|
||||
code = 'function add(first, second) { return first + second; }';
|
||||
minify(code, { toplevel: true });
|
||||
|
||||
minify(code, {
|
||||
@ -27,7 +27,7 @@ const output = minify(code, {
|
||||
warnings: 'verbose',
|
||||
mangle: {
|
||||
properties: {
|
||||
regex: /reg/
|
||||
regex: /reg/,
|
||||
},
|
||||
toplevel: true,
|
||||
},
|
||||
@ -38,12 +38,15 @@ const output = minify(code, {
|
||||
compress: {
|
||||
arguments: true,
|
||||
global_defs: {
|
||||
"@console.log": "alert"
|
||||
'@console.log': 'alert',
|
||||
},
|
||||
passes: 2,
|
||||
},
|
||||
nameCache: {},
|
||||
});
|
||||
if (output.warnings) {
|
||||
output.warnings.filter(x => x === 'Dropping unused variable');
|
||||
}
|
||||
|
||||
const compressOptions = {
|
||||
booleans: true,
|
||||
@ -63,6 +66,8 @@ minify(code, {
|
||||
compress: compressOptions,
|
||||
});
|
||||
|
||||
if (output.warnings) {
|
||||
output.warnings.filter(x => x === 'Dropping unused variable');
|
||||
}
|
||||
minify(code, {
|
||||
sourceMap: {
|
||||
content: 'inline',
|
||||
},
|
||||
});
|
||||
|
||||
Loading…
Reference in New Issue
Block a user