Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/fix dependencies #99

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

phoenix741
Copy link

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
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