diff --git a/netlify.toml b/netlify.toml index 6e79d9c..b79d30b 100755 --- a/netlify.toml +++ b/netlify.toml @@ -2,7 +2,7 @@ NPM_FLAGS = "--prefix=/dev/null" [build] - publish = ".presite" + publish = "dist" command = "npx pnpm i --store=node_modules/.pnpm-store && npx pnpm run build" [[redirects]] diff --git a/package.json b/package.json index 953f0d8..e8475fa 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "private": true, "scripts": { "dev": "vite --port 3333 --open", - "build": "cross-env NODE_ENV=production vite build && esno scripts/ssg.ts" + "build": "cross-env NODE_ENV=production vite build" }, "dependencies": { "@iconify/iconify": "^2.0.0-rc.2", @@ -22,7 +22,7 @@ "@vue/compiler-sfc": "^3.0.4", "@vuedx/typescript-plugin-vue": "^0.2.3", "autoprefixer": "^10.1.0", - "chromium": "3.0.2", + "chromium": "^3.0.2", "cross-env": "^7.0.3", "eslint": "^7.15.0", "esno": "^0.3.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index f675ba6..b6ac3c6 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -6975,7 +6975,7 @@ specifiers: '@vuedx/typescript-plugin-vue': ^0.2.3 '@vueuse/core': ^4.0.0-rc.8 autoprefixer: ^10.1.0 - chromium: 3.0.2 + chromium: ^3.0.2 cross-env: ^7.0.3 eslint: ^7.15.0 esno: ^0.3.0 diff --git a/scripts/ssg.ts b/scripts/ssg.ts index 38be1f7..ef1cb5a 100644 --- a/scripts/ssg.ts +++ b/scripts/ssg.ts @@ -1,7 +1,8 @@ -import { execSync } from 'child_process' -// @ts-ignore -import { path } from 'chromium' - +/* eslint-disable @typescript-eslint/no-var-requires */ console.log('Starting SSG...') -execSync(`npx cross-env CHROME_PATH="${path}" presite dist`, { stdio: 'inherit' }) + +const { execSync } = require('child_process') +const chromium = require('chromium') + +execSync(`npx cross-env CHROME_PATH="${chromium.path}" presite dist`, { stdio: 'inherit' }) console.log('SSG Finished...')