Skip to content

Commit

Permalink
minor refactor: rename set_constant_ASSETS_MAP => set_ASSETS_MAP
Browse files Browse the repository at this point in the history
  • Loading branch information
brillout committed Aug 23, 2024
1 parent 6da64f6 commit f91574a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions vike/node/plugin/plugins/buildConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import { createRequire } from 'module'
import fs from 'fs/promises'
import path from 'path'
import { fixServerAssets, fixServerAssets_isEnabled } from './buildConfig/fixServerAssets.js'
import { set_constant_ASSETS_MAP } from './importBuild/index.js'
import { set_ASSETS_MAP } from './importBuild/index.js'
import { prependEntriesDir } from '../../shared/prependEntriesDir.js'
import { getFilePathResolved } from '../shared/getFilePath.js'
import { getConfigValueBuildTime } from '../../../shared/page-configs/getConfigValueBuildTime.js'
Expand Down Expand Up @@ -90,7 +90,7 @@ function buildConfig(): Plugin[] {
name: 'vike:buildConfig:writeBundle',
apply: 'build',
// Make sure other writeBundle() hooks are called after this writeBundle() hook.
// - set_constant_ASSETS_MAP() needs to be called before dist/server/ code is executed.
// - set_ASSETS_MAP() needs to be called before dist/server/ code is executed.
// - For example, the writeBundle() hook of vite-plugin-vercel needs to be called after this writeBundle() hook, otherwise: https://github.com/vikejs/vike/issues/1527
enforce: 'pre',
writeBundle: {
Expand All @@ -112,7 +112,7 @@ function buildConfig(): Plugin[] {
}
await fs.rm(clientManifestFilePath)
await fs.rm(serverManifestFilePath)
await set_constant_ASSETS_MAP(options, bundle)
await set_ASSETS_MAP(options, bundle)
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions vike/node/plugin/plugins/importBuild/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export { importBuild }
export { set_constant_ASSETS_MAP }
export { set_ASSETS_MAP }

import type { Plugin, ResolvedConfig, Rollup } from 'vite'
import { serverEntryPlugin, findServerEntry } from '@brillout/vite-plugin-server-entry/plugin.js'
Expand Down Expand Up @@ -61,7 +61,7 @@ function getEntryCode(config: ResolvedConfig, configVike: ConfigVikeResolved): s
return importerCode
}
/** Set the value of the ASSETS_MAP constant inside dist/server/entry.js (or dist/server/index.js) */
async function set_constant_ASSETS_MAP(options: Options, bundle: Bundle) {
async function set_ASSETS_MAP(options: Options, bundle: Bundle) {
const { dir } = options
assert(dir)
// This will probably fail with @vitejs/plugin-legacy
Expand Down

0 comments on commit f91574a

Please sign in to comment.