Skip to content

Commit

Permalink
🔧 (next-config) NICE-64 outputFileTracingExcludes swc (#1743)
Browse files Browse the repository at this point in the history
Issue is storybook@7 ships with `swc` and need to exclude it since
 production does not need it and ... not sure what is happening.

```bash
Serverless Function's page: ...
Large Dependencies                                                      Uncompressed size  Compressed size
node_modules/.pnpm/@swc[email protected]                               51.77 MB         17.18 MB
node_modules/.pnpm/@swc[email protected]                                44.48 MB         14.62 MB
node_modules/.pnpm/[email protected]                                                   16.1 MB          6.95 MB
node_modules/.pnpm/[email protected][email protected][email protected]           21.98 MB          5.43 MB
node_modules/.pnpm/@esbuild[email protected]                                      8.77 MB          3.68 MB
node_modules/.pnpm/[email protected]_@[email protected]                                4.05 MB         997.6 KB
node_modules/.pnpm/[email protected][email protected]                                  1.64 MB        405.36 KB
node_modules/.pnpm/[email protected]                                     905.8 KB        326.36 KB
node_modules/.pnpm/[email protected]                                               1.13 MB        208.12 KB
node_modules/.pnpm/[email protected]                                                 964.3 KB        185.13 KB
sites/jeromefitzgerald.com/.next                                                923.68 KB        162.89 KB
All dependencies                                                                 17.98 MB         50.85 MB
```
  • Loading branch information
JeromeFitz authored Jul 21, 2023
1 parent 1cd0ff1 commit f7b3210
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/next-config/next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,14 @@ const config = ({
experimental: {
appDir: true,
legacyBrowsers: false,
// @note(next) storybook needs this -- but nothing else.
outputFileTracingExcludes: {
'*': [
'node_modules/.pnpm/@swc+core-linux-x64-musl',
'node_modules/.pnpm/@swc+core-linux-x64-gnu',
'node_modules/.pnpm/@esbuild+linux-x64',
],
},
// @note(next) monorepo root
outputFileTracingRoot: join(pathDirName, '../../'),
serverComponentsExternalPackages,
Expand Down

0 comments on commit f7b3210

Please sign in to comment.