0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2025-03-10 23:01:26 -05:00

fix: ensure outDir doesn't lead to bundlers bloating Lambda size (#10550)

* fix: ensure outDir doesn't lead to bundlers bloating Lambda size

* add changeset

* Update packages/astro/src/assets/vite-plugin-assets.ts

Co-authored-by: Emanuele Stoppa <my.burning@gmail.com>

---------

Co-authored-by: Emanuele Stoppa <my.burning@gmail.com>
This commit is contained in:
Simon Knott 2024-03-26 11:44:04 +01:00 committed by GitHub
parent 441b0867c2
commit 9cb7501c9c

View file

@ -18,6 +18,18 @@ describe('Serverless prerender', () => {
assert.ok(await fixture.readFile('../.vercel/output/static/index.html'));
});
it('outDir is tree-shaken if not needed', async () => {
const [file] = await fixture.glob(
'../.vercel/output/functions/_render.func/packages/integrations/vercel/test/fixtures/serverless-prerender/.vercel/output/_functions/chunks/pages/generic_*.mjs'
);
const contents = await fixture.readFile(file);
console.log(contents)
assert.ok(
!contents.includes('const outDir ='),
"outDir is tree-shaken if it's not imported"
);
});
// TODO: The path here seems to be inconsistent?
it.skip('includeFiles work', async () => {
assert.ok(