Skip to content

Commit ac9e7b6

Browse files
committed
add --map option to cli
1 parent 724968b commit ac9e7b6

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

src/cli.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@ module.exports = async function cli() {
6363
// Disable minification
6464
keepnames : [ ' ', '--keep-names', false, true ],
6565

66+
// Devtool setting
67+
devtool : [ ' ', '--map', null, true, true ],
68+
6669
// Extend config
6770
extend : [ '-e', '--extend', null, true, true ],
6871

@@ -183,6 +186,15 @@ module.exports = async function cli() {
183186
};
184187
}
185188

189+
// Source map/devtool settings
190+
if ( options.devtool ) {
191+
if ( typeof options.devtool === 'string' ) {
192+
swpOptions.devtool = options.devtool;
193+
} else {
194+
swpOptions.devtool = swp.production ? 'source-map' : 'eval-source-map';
195+
}
196+
}
197+
186198
// Index source mode
187199
if ( options.index ) {
188200
swpOptions.source = 'index';

0 commit comments

Comments
 (0)