diff --git a/bin/stencil-bundle.js b/bin/stencil-bundle.js index 4c2ce6db..4f9bf090 100755 --- a/bin/stencil-bundle.js +++ b/bin/stencil-bundle.js @@ -13,6 +13,7 @@ program '-d, --dest [dest]', 'Where to save the zip file. It defaults to the current directory you are in when bundling', ) + .option('-S, --source-maps', 'Include source-maps in the bundle. This is useful for debugging') .option( '-n, --name [filename]', 'What do you want to call the zip file. It defaults to stencil-bundle.zip', diff --git a/bin/stencil-push.js b/bin/stencil-push.js index 1cef84ed..87445630 100755 --- a/bin/stencil-push.js +++ b/bin/stencil-push.js @@ -9,6 +9,7 @@ program .version(PACKAGE_INFO.version) .option('-f, --file [filename]', 'specify the filename of the bundle to upload') .option('-s, --save [filename]', 'specify the filename to save the bundle as') + .option('-S, --source-maps', 'Include source-maps in the bundle. This is useful for debugging') .option('-a, --activate [variationname]', 'specify the variation of the theme to activate') .option('-d, --delete', 'delete oldest private theme if upload limit reached') .option( @@ -25,6 +26,7 @@ const options = { saveBundleName: cliOptions.save, deleteOldest: cliOptions.delete, allChannels: cliOptions.all_channels, + sourceMaps: cliOptions.source_maps, }; stencilPush(options, (err, result) => { if (err) { diff --git a/lib/stencil-bundle.js b/lib/stencil-bundle.js index aad2f68f..e8e9b8fb 100644 --- a/lib/stencil-bundle.js +++ b/lib/stencil-bundle.js @@ -18,7 +18,7 @@ const MAX_SIZE_BUNDLE = MEGABYTE * 50; const PATHS_TO_ZIP = [ { pattern: 'assets/**/*', - ignore: ['assets/cdn/**', 'assets/**/*.js.map'], + ignore: ['assets/cdn/**'], }, { pattern: 'CHANGELOG.md' }, { pattern: 'config.json' }, @@ -387,6 +387,9 @@ class Bundle { */ _bundleThemeFiles(archive, themePath) { for (const { pattern, ignore } of PATHS_TO_ZIP) { + if (pattern === 'assets/**/*' && !this.options.sourceMaps) { + ignore.push('assets/**/*.js.map'); + } archive.glob(pattern, { ignore, cwd: themePath }); } } diff --git a/package-lock.json b/package-lock.json index 140751b0..d000b119 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@bigcommerce/stencil-cli", - "version": "8.2.0", + "version": "8.3.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@bigcommerce/stencil-cli", - "version": "8.2.0", + "version": "8.3.0", "license": "BSD-4-Clause", "dependencies": { "@bigcommerce/stencil-paper": "5.0.0",