From c56f61e056df5b520988cf49b097135adcd7d715 Mon Sep 17 00:00:00 2001 From: Haishan Date: Mon, 7 Jun 2021 21:02:28 +0800 Subject: [PATCH] Change web base to './' --- package.json | 1 - vite.config.ts | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 60ec97d..e767158 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,6 @@ "dev": "vite", "start": "vite", "build": "vite build", - "postbuild": "cp assets/* public", "serve": "vite preview", "pretty": "prettier --single-quote --write 'src/**/*.{js,scss,ts,tsx,md}'" }, diff --git a/vite.config.ts b/vite.config.ts index be57729..c3b00d6 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -11,6 +11,7 @@ export default defineConfig(({ mode }) => ({ 'process.env.NODE_ENV': JSON.stringify(mode), 'process.env.PUBLIC_URL': JSON.stringify('./'), }, + base: './', publicDir: 'assets', build: { // the default value is 'dist' @@ -25,6 +26,7 @@ export default defineConfig(({ mode }) => ({ outDir: 'public', filename: 'sw.ts', strategies: 'injectManifest', + base: './', }), ], resolve: {