Skip to content

Commit 21bb90c

Browse files
committedFeb 24, 2019
feat(cli): add --map flag
1 parent 933fbfe commit 21bb90c

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed
 

‎src/cli.ts

+6-1
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ cli
4040
.option('-c, --config <file>', 'Use a custom config file')
4141
.option('--minimal', 'Generate minimal output whenever possible')
4242
.option('--banner', 'Add banner with pkg info to the bundle')
43+
.option(
44+
'--no-map',
45+
'Disable source maps, enabled by default for minified bundles'
46+
)
4347
.option('--no-async-pro, --no-async-to-promises', 'Leave async/await as is')
4448
.option('--concurrent', 'Build concurrently')
4549
.option('--verbose', 'Show verbose logs')
@@ -59,7 +63,8 @@ cli
5963
moduleName: options.moduleName,
6064
fileName: options.fileName,
6165
minify: options.minify,
62-
extractCSS: options.extractCss
66+
extractCSS: options.extractCss,
67+
sourceMap: options.map
6368
},
6469
bundleNodeModules: options.bundleNodeModules,
6570
env: options.env,

‎src/index.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,10 @@ export class Bundler {
186186

187187
// Always minify if config.minify is truthy
188188
// Otherwise infer by format
189-
const minify = config.output.minify || format.endsWith('-min')
189+
const minify =
190+
config.output.minify === undefined
191+
? format.endsWith('-min')
192+
: config.output.minify
190193
let minPlaceholder = ''
191194
let rollupFormat: RollupFormat
192195
if (format.endsWith('-min')) {

0 commit comments

Comments
 (0)
Please sign in to comment.