@opennextjs/aws 3.10.3 → 3.10.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -16,8 +16,8 @@ import * as buildHelper from "./helper.js";
|
|
|
16
16
|
export function createStaticAssets(options, { useBasePath = false } = {}) {
|
|
17
17
|
logger.info("Bundling static assets...");
|
|
18
18
|
const { appBuildOutputPath, appPublicPath, outputDir, appPath } = options;
|
|
19
|
-
const
|
|
20
|
-
const basePath = useBasePath ? (
|
|
19
|
+
const nextConfig = loadConfig(path.join(appBuildOutputPath, ".next"));
|
|
20
|
+
const basePath = useBasePath ? (nextConfig.basePath ?? "") : "";
|
|
21
21
|
// Create output folder
|
|
22
22
|
const outputPath = path.join(outputDir, "assets", basePath);
|
|
23
23
|
fs.mkdirSync(outputPath, { recursive: true });
|
|
@@ -65,9 +65,11 @@ export function createCacheAssets(options) {
|
|
|
65
65
|
const { appBuildOutputPath, outputDir } = options;
|
|
66
66
|
const packagePath = buildHelper.getPackagePath(options);
|
|
67
67
|
const buildId = buildHelper.getBuildId(options);
|
|
68
|
+
const nextConfig = loadConfig(path.join(appBuildOutputPath, ".next"));
|
|
69
|
+
const openNextBuildId = nextConfig.deploymentId ?? buildId;
|
|
68
70
|
let useTagCache = false;
|
|
69
71
|
const dotNextPath = path.join(appBuildOutputPath, ".next/standalone", packagePath);
|
|
70
|
-
const outputCachePath = path.join(outputDir, "cache",
|
|
72
|
+
const outputCachePath = path.join(outputDir, "cache", openNextBuildId);
|
|
71
73
|
fs.mkdirSync(outputCachePath, { recursive: true });
|
|
72
74
|
const sourceDirs = [".next/server/pages", ".next/server/app"]
|
|
73
75
|
.map((dir) => path.join(dotNextPath, dir))
|