Skip to content

Commit 33e3a97

Browse files
jamesmbournemiguel-a-calles-mba
authored andcommitted
Skip compile & packaging if --no-build is set (serverless-heaven#560)
* Add copyExistingArtifacts to packageModules * Refactor packageModules * Set service path * Generate artifact name from service * Output artifacts to .webpack before copying * Set artifact name for service packaging * Skip webpack:compile if --no-build is set * Add webpack:package:copyExistingArtifacts hook * Make packageModules & packExternalModules no-op if skipCompile is set * Refactor packageModules * Remove artifact location setting from packageModules * Update cleanup to check this.keepOutputDirectory * Fix path join on Windows Co-authored-by: Miguel A. Calles MBA <44813512+miguel-a-calles-mba@users.noreply.github.com>
1 parent 4d8ff23 commit 33e3a97

File tree

3 files changed

+3
-5
lines changed

3 files changed

+3
-5
lines changed

lib/cleanup.js

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ module.exports = {
1010
const keepOutputDirectory = this.keepOutputDirectory;
1111
const cli = this.options.verbose ? this.serverless.cli : { log: _.noop };
1212

13+
const keepOutputDirectory = this.keepOutputDirectory;
1314
if (!keepOutputDirectory) {
1415
cli.log(`Remove ${webpackOutputPath}`);
1516
if (this.serverless.utils.dirExistsSync(webpackOutputPath)) {

tests/cleanup.test.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,7 @@ describe('cleanup', () => {
5555
module = _.assign(
5656
{
5757
serverless,
58-
options: {
59-
verbose: true
60-
},
58+
options: {},
6159
webpackOutputPath: 'my/Output/Path'
6260
},
6361
baseModule

tests/packageModules.test.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,7 @@ describe('packageModules', () => {
7474
{
7575
serverless,
7676
options: {},
77-
webpackOutputPath: '.webpack',
78-
configuration: new Configuration()
77+
webpackOutputPath: '.webpack'
7978
},
8079
baseModule
8180
);

0 commit comments

Comments
 (0)