Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimize npm script #31

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ lerna-debug.log*

node_modules
dist
site
MaxLeiter marked this conversation as resolved.
Show resolved Hide resolved
dist-ssr
*.local

Expand Down
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ lerna-debug.log*

node_modules
dist-ssr
site
*.local

# Editor directories and files
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
},
"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",
"preview": "vite preview --config vite.site.config.ts",
"lint": "yarn prettier --write '**/*.{ts,vue,json}'"
},
"types": "./dist/types/main.d.ts",
Expand Down
1 change: 1 addition & 0 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import * as path from "path";

// https://vitejs.dev/config/
export default defineConfig({
publicDir: false,
plugins: [vue()],
resolve: {
dedupe: ["vue"],
Expand Down
6 changes: 6 additions & 0 deletions vite.site.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
});