Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion packages/open-next/src/build/copyTracedFiles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import url from "node:url";

import {
copyFileSync,
cpSync,
existsSync,
mkdirSync,
readFileSync,
Expand Down Expand Up @@ -360,11 +361,25 @@ File ${serverPath} does not exist
.forEach((file) => copyStaticFile(`server/${file}`));
}

const manifests = getManifests(standaloneNextDir);

const { optimizeCss } = manifests.config.experimental;

// Copy .next/static/css from standalone to output dir
// needed for optimizeCss feature to work
if (optimizeCss) {
cpSync(
path.join(standaloneNextDir, "static", "css"),
path.join(outputNextDir, "static", "css"),
{ recursive: true },
);
}

logger.debug("copyTracedFiles:", Date.now() - tsStart, "ms");

return {
tracedFiles,
nodePackages,
manifests: getManifests(standaloneNextDir),
manifests,
};
}
1 change: 1 addition & 0 deletions packages/open-next/src/types/next-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ export interface NextConfig {
experimental: {
serverActions?: boolean;
appDir?: boolean;
optimizeCss?: boolean;
};
images: ImageConfig;
poweredByHeader?: boolean;
Expand Down