Skip to content

Commit

Permalink
Add chunks path constant
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewp committed Apr 18, 2024
1 parent ad0cd07 commit 5c59f1b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions packages/astro/src/core/build/consts.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const CHUNKS_PATH = 'chunks/';
3 changes: 2 additions & 1 deletion packages/astro/src/core/build/plugins/plugin-content.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import type { StaticBuildOptions } from '../types.js';
import { encodeName } from '../util.js';
import { extendManualChunks } from './util.js';
import { emptyDir } from '../../fs/index.js';
import { CHUNKS_PATH } from '../consts.js';

const CONTENT_CACHE_DIR = './content/';
const CONTENT_MANIFEST_FILE = './manifest.json';
Expand Down Expand Up @@ -425,7 +426,7 @@ export function pluginContent(
): AstroBuildPlugin {
const { cacheDir, outDir } = opts.settings.config;

const chunksFolder = './chunks/';
const chunksFolder = './' + CHUNKS_PATH;
const assetsFolder = './' + appendForwardSlash(opts.settings.config.build.assets);
// These are build output that is kept in the cache.
const cachedBuildOutput = [
Expand Down
3 changes: 2 additions & 1 deletion packages/astro/src/core/build/static-build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import { RESOLVED_SPLIT_MODULE_ID, RESOLVED_SSR_VIRTUAL_MODULE_ID } from './plug
import { ASTRO_PAGE_EXTENSION_POST_PATTERN } from './plugins/util.js';
import type { StaticBuildOptions } from './types.js';
import { encodeName, getTimeStat, viteBuildReturnToRollupOutputs } from './util.js';
import { CHUNKS_PATH } from './consts.js';

export async function viteBuild(opts: StaticBuildOptions) {
const { allPages, settings } = opts;
Expand Down Expand Up @@ -196,7 +197,7 @@ async function ssrBuild(
// We need to keep these separate
chunkFileNames(chunkInfo) {
const { name } = chunkInfo;
let prefix = 'chunks/';
let prefix = CHUNKS_PATH;
let suffix = '_[hash].mjs';

if (isContentCache) {
Expand Down

0 comments on commit 5c59f1b

Please sign in to comment.