From a5b42dec2fe035cc30dcefffdb1aa2c2dc580afc Mon Sep 17 00:00:00 2001 From: hxz <1725672603@qq.com> Date: Mon, 26 Sep 2022 09:16:41 +0800 Subject: [PATCH 1/3] build(package): use config replace cmd --- package.json | 2 +- vite.config.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 39a20eb..e465094 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ }, "scripts": { "dev": "vite", - "build": "vite build && vue-tsc --emitDeclarationOnly --project tsconfig.dist.json && mv dist/lib dist/types && rm -rf dist/favicon.ico", + "build": "vite build && vue-tsc --emitDeclarationOnly --project tsconfig.dist.json && mv dist/lib dist/types", "build:site": "vue-tsc --noEmit --project tsconfig.site.json && vite --config vite.site.config.ts build", "preview": "vite preview", "lint": "yarn prettier --write '**/*.{ts,vue,json}'" diff --git a/vite.config.ts b/vite.config.ts index 7dfb2b8..52e7b39 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -4,6 +4,7 @@ import * as path from "path"; // https://vitejs.dev/config/ export default defineConfig({ + publicDir: false, plugins: [vue()], resolve: { dedupe: ["vue"], From 1c024770c7ecff6911325abd3a83d971cabb4fb6 Mon Sep 17 00:00:00 2001 From: hxz <1725672603@qq.com> Date: Mon, 26 Sep 2022 09:27:42 +0800 Subject: [PATCH 2/3] build(package): separate lib and site dir --- .gitignore | 1 + package.json | 2 +- vite.site.config.ts | 6 ++++++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index d98b9c0..2a6e9a8 100644 --- a/.gitignore +++ b/.gitignore @@ -9,6 +9,7 @@ lerna-debug.log* node_modules dist +site dist-ssr *.local diff --git a/package.json b/package.json index e465094..11012c7 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ "dev": "vite", "build": "vite build && vue-tsc --emitDeclarationOnly --project tsconfig.dist.json && mv dist/lib dist/types", "build:site": "vue-tsc --noEmit --project tsconfig.site.json && vite --config vite.site.config.ts build", - "preview": "vite preview", + "preview": "vite preview --config vite.site.config.ts", "lint": "yarn prettier --write '**/*.{ts,vue,json}'" }, "types": "./dist/types/main.d.ts", diff --git a/vite.site.config.ts b/vite.site.config.ts index 0a8bd80..383104a 100644 --- a/vite.site.config.ts +++ b/vite.site.config.ts @@ -4,4 +4,10 @@ import vue from "@vitejs/plugin-vue"; // https://vitejs.dev/config/ export default defineConfig({ plugins: [vue()], + build: { + outDir: "site", + }, + preview: { + port: 3000, + }, }); From 8e407c43aab87902886bd3b1ff293f5763429667 Mon Sep 17 00:00:00 2001 From: hxz <1725672603@qq.com> Date: Tue, 27 Sep 2022 17:43:43 +0800 Subject: [PATCH 3/3] chore(npmignore ): npm publish ignore site dir --- .npmignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.npmignore b/.npmignore index 5223299..0826ad4 100644 --- a/.npmignore +++ b/.npmignore @@ -10,6 +10,7 @@ lerna-debug.log* node_modules dist-ssr +site *.local # Editor directories and files