Fix Cloudflare Pages build (#1285)

* fix(temp): remove box shadows from tailwind config

* fix(temp): "polyfill" global during build process

* refactor: use `import.meta` instead of deprecated `process`

* oops: replace `process.server` as well
This commit is contained in:
Evan Song
2024-07-10 22:17:04 -07:00
committed by GitHub
parent 04ba76aac8
commit c20242cf1c
13 changed files with 25 additions and 30 deletions

View File

@@ -1500,7 +1500,7 @@ const collapsedChecklist = ref(false);
const showModerationChecklist = ref(false);
const futureProjects = ref([]);
if (process.client && history && history.state && history.state.showChecklist) {
if (import.meta.client && history && history.state && history.state.showChecklist) {
showModerationChecklist.value = true;
futureProjects.value = history.state.projects;
}

View File

@@ -779,7 +779,7 @@ export default defineNuxtComponent({
featured: false,
};
// For navigation from versions page / upload file prompt
if (process.client && history.state && history.state.newPrimaryFile) {
if (import.meta.client && history.state && history.state.newPrimaryFile) {
replaceFile = history.state.newPrimaryFile;
try {

View File

@@ -130,7 +130,7 @@ useHead({
const user = await useUser();
const auth = await useAuth();
if (process.client) {
if (import.meta.client) {
await initUserFollows();
}

View File

@@ -152,7 +152,7 @@ async function readAll() {
function changePage(newPage) {
page.value = newPage;
if (process.client) {
if (import.meta.client) {
window.scrollTo({ top: 0, behavior: "smooth" });
}
}

View File

@@ -465,7 +465,7 @@ const {
} = useLazyFetch(
() => {
const config = useRuntimeConfig();
const base = process.server ? config.apiBaseUrl : config.public.apiBaseUrl;
const base = import.meta.server ? config.apiBaseUrl : config.public.apiBaseUrl;
const params = [`limit=${maxResults.value}`, `index=${sortType.value.name}`];
@@ -589,7 +589,7 @@ function onSearchChange(newPageNumber) {
refreshSearch();
if (process.client) {
if (import.meta.client) {
const obj = getSearchUrl((currentPage.value - 1) * maxResults.value, true);
router.replace({ path: route.path, query: obj });
}
@@ -751,7 +751,7 @@ function toggleEnv(environment, sendRequest) {
}
function onSearchChangeToTop(newPageNumber) {
if (process.client) {
if (import.meta.client) {
window.scrollTo({ top: 0, behavior: "smooth" });
}