Skip to content

Commit

Permalink
Added source-map option
Browse files Browse the repository at this point in the history
  • Loading branch information
Cristian Bote committed Feb 5, 2018
1 parent c536556 commit 845c6c5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/cli.js
Expand Up @@ -18,7 +18,8 @@ prog
.option('--compress', 'Compress output using UglifyJS', true)
.option('--strict', 'Enforce undefined global context and add "use strict"')
.option('--name', 'Specify name exposed in UMD builds')
.option('--cwd', 'Use an alternative working directory', '.');
.option('--cwd', 'Use an alternative working directory', '.')
.option('--source-map', 'Enable the source map', true);

prog
.command('build [...entries]', '', { default: true })
Expand Down
2 changes: 1 addition & 1 deletion src/index.js
Expand Up @@ -310,7 +310,7 @@ function createConfig(options, entry, format, writeMeta) {
strict: options.strict===true,
legacy: true,
freeze: false,
sourcemap: true,
sourcemap: options.sourcemap===true || options.sourceMap===true,
treeshake: {
propertyReadSideEffects: false
},
Expand Down
3 changes: 2 additions & 1 deletion test/index.test.js
Expand Up @@ -28,7 +28,8 @@ describe('fixtures', () => {
it(fixtureDir, async () => {
const output = await microbundle({
cwd: path.resolve(fixturePath),
formats: 'es,cjs,umd'
formats: 'es,cjs,umd',
sourceMap: true
});

const printedDir = printTree([dirTree(fixturePath)]);
Expand Down

0 comments on commit 845c6c5

Please sign in to comment.