Skip to content

Feature/fix dependencies#99

Open
phoenix741 wants to merge 2 commits intodougmoscrop:masterfrom
phoenix741:feature/fix-dependencies
Open

Feature/fix dependencies#99
phoenix741 wants to merge 2 commits intodougmoscrop:masterfrom
phoenix741:feature/fix-dependencies

Conversation

@phoenix741
Copy link
Copy Markdown

I propose this PR to fix #98.

There is two modification :

  • include global pattern even when package individually is true.
  • add an optimisation to not read the same file (i have 12 lambda individually packaged, with optimisation packaging take 79s, without, packaging take 152s; each lambda files is readed 3 times with predict.paperwork)

@phoenix741
Copy link
Copy Markdown
Author

My modification will break this TU:

test('enables caching', t => {
  const instance = createTestInstance({ 
    serverless: {
      service: { custom: { includeDependencies: { enableCaching: true } } }
    }
  });
  const cacheEnabled = instance.cacheEnabled;
  t.true(cacheEnabled);
  const file = path.join(__dirname, 'fixtures', 'thing.js');
  const list1 = instance.getDependencies(file, [], cacheEnabled);
  const list2 = instance.getDependencies(file, [], cacheEnabled);

  console.log(list1);
  console.log(list2);
  t.true(list2.length < list1.length);
});

I'm not sur why because we read two time the same file, and the test thing to have two different result, but with the global cache, i have always the same result.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

serverless-plugin-common-excludes not working when individually == true

1 participant