Skip to content

Commit

Permalink
Skip compile & packaging if --no-build is set (serverless-heaven#560)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
2 people authored and vicary committed Mar 1, 2021
1 parent 4d8ff23 commit 33e3a97
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
1 change: 1 addition & 0 deletions lib/cleanup.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ module.exports = {
const keepOutputDirectory = this.keepOutputDirectory;
const cli = this.options.verbose ? this.serverless.cli : { log: _.noop };

const keepOutputDirectory = this.keepOutputDirectory;
if (!keepOutputDirectory) {
cli.log(`Remove ${webpackOutputPath}`);
if (this.serverless.utils.dirExistsSync(webpackOutputPath)) {
Expand Down
4 changes: 1 addition & 3 deletions tests/cleanup.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,7 @@ describe('cleanup', () => {
module = _.assign(
{
serverless,
options: {
verbose: true
},
options: {},
webpackOutputPath: 'my/Output/Path'
},
baseModule
Expand Down
3 changes: 1 addition & 2 deletions tests/packageModules.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,7 @@ describe('packageModules', () => {
{
serverless,
options: {},
webpackOutputPath: '.webpack',
configuration: new Configuration()
webpackOutputPath: '.webpack'
},
baseModule
);
Expand Down

0 comments on commit 33e3a97

Please sign in to comment.