Skip to content

Commit bbc4902

Browse files
committedMar 19, 2019
feat: add output.mapExcludeSources option
1 parent 69abc64 commit bbc4902

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed
 

‎src/cli.ts

+2
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ cli
4545
'--no-map',
4646
'Disable source maps, enabled by default for minified bundles'
4747
)
48+
.option('--map-exclude-sources', 'Exclude source code in source maps')
4849
.option('--no-async-pro, --no-async-to-promises', 'Leave async/await as is')
4950
.option('--concurrent', 'Build concurrently')
5051
.option('--verbose', 'Show verbose logs')
@@ -66,6 +67,7 @@ cli
6667
minify: options.minify,
6768
extractCSS: options.extractCss,
6869
sourceMap: options.map,
70+
sourceMapExcludeSources: options.mapExcludeSources,
6971
target: options.target
7072
},
7173
bundleNodeModules: options.bundleNodeModules,

‎src/index.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -473,7 +473,8 @@ export class Bundler {
473473
sourcemap:
474474
typeof config.output.sourceMap === 'boolean'
475475
? config.output.sourceMap
476-
: minify
476+
: minify,
477+
sourcemapExcludeSources: config.output.sourceMapExcludeSources
477478
}
478479
}
479480
}

‎src/types.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -125,10 +125,14 @@ export interface ConfigOutput {
125125
*/
126126
extractCSS?: boolean
127127
/**
128-
* Generate source map
128+
* Generate source maps
129129
* @default `true` for minified bundle, `false` otherwise
130130
*/
131131
sourceMap?: boolean
132+
/**
133+
* Exclude source code in source maps
134+
*/
135+
sourceMapExcludeSources?: boolean
132136
/**
133137
* Output target
134138
* @default `node`

0 commit comments

Comments
 (0)
Please sign in to comment.