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 9096c94
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 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
8 changes: 5 additions & 3 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 Expand Up @@ -364,7 +366,7 @@ describe('packageModules', () => {

module.compileStats = stats;
return expect(module.packageModules()).to.be.fulfilled
.then(() => expect(globbyMock.sync).to.have.been.calledWith([ '**', '!*.map', 'special.map', '*.js' ]));
.then(() => expect(globbyMock.sync).to.have.been.calledWith([ '**', '!*.map', 'special.map', '*.js' ], ));
});

describe('with individual packaging', () => {
Expand Down

0 comments on commit 9096c94

Please sign in to comment.