Skip to content

Commit

Permalink
chore(vite): rename admin output to assets-admin
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelgerber committed Apr 3, 2024
1 parent 2da07de commit 548522d
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion adminSiteServer/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ export class OwidAdminApp {
app.use("/fonts", express.static("public/fonts"))

app.use("/api", publicApiRouter.router)
app.use("/admin/assets", express.static("dist/admin/assets"))
app.use("/assets-admin", express.static("dist/assets-admin"))
app.use("/admin/api", apiRouter.router)
app.use("/admin/test", testPageRouter)
app.use("/admin/storybook", express.static(".storybook/build"))
Expand Down
4 changes: 4 additions & 0 deletions baker/SiteBaker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -937,6 +937,10 @@ export class SiteBaker {
await execWrapper(
`rm -rf ${this.bakedSiteDir}/assets && cp -r ${BASE_DIR}/dist/assets ${this.bakedSiteDir}/assets`
)
await execWrapper(
`rm -rf ${this.bakedSiteDir}/assets-admin && cp -r ${BASE_DIR}/dist/assets-admin ${this.bakedSiteDir}/assets-admin`
)

await this.validateTagIcons(trx)
await execWrapper(
`rsync -hav --delete ${BASE_DIR}/public/* ${this.bakedSiteDir}/ ${excludes}`
Expand Down
2 changes: 1 addition & 1 deletion site/viteUtils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ export const createTagsForManifestEntry = (
const prodAssets = (entry: string, baseUrl: string): Assets => {
const baseDir = findBaseDir(__dirname)
const manifestBasePath = `${baseDir}/dist/`
const manifestDirs = ["assets", "admin/assets"]
const manifestDirs = ["assets", "assets-admin"]
let mergedManifest
try {
mergedManifest = manifestDirs.reduce((acc, path) => {
Expand Down
2 changes: 1 addition & 1 deletion vite.config-admin.mts
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ import { defineViteConfigForEntrypoint } from "./vite.config-common.mts"
export default defineViteConfigForEntrypoint(
"admin",
VITE_ASSET_ADMIN_ENTRY,
"dist/admin/assets"
"dist/assets-admin"
)

0 comments on commit 548522d

Please sign in to comment.