Skip to content

Commit

Permalink
Move to custom config
Browse files Browse the repository at this point in the history
  • Loading branch information
janicduplessis committed Apr 3, 2018
1 parent 63671e5 commit 29b6f75
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/packageModules.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ function zip(directory, name) {

const output = fs.createWriteStream(artifactFilePath);

const exclude = _.get(this.serverless, 'service.package.exclude', []);
const include = _.get(this.serverless, 'service.package.include', []);
const exclude = _.get(this.configuration, 'package.exclude', []);
const include = _.get(this.configuration, 'package.include', []);

const patterns = _.concat(
['**'],
Expand Down
6 changes: 4 additions & 2 deletions tests/packageModules.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -320,8 +320,10 @@ describe('packageModules', () => {
});

it('should respect package.include and package.exclude', () => {
_.set(serverless.service.package, 'include', ['*.js']);
_.set(serverless.service.package, 'exclude', ['*.map', '!special.map']);
_.set(module, 'configuration.package', {
include: ['*.js'],
exclude: [ '*.map', '!special.map' ],
});

// Test data
const stats = {
Expand Down

0 comments on commit 29b6f75

Please sign in to comment.