Skip to content

Commit b2e2d8a

Browse files
committed
fix: added missing playground vite config and dev script
1 parent 2707d83 commit b2e2d8a

File tree

3 files changed

+48
-1
lines changed

3 files changed

+48
-1
lines changed

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@
6666
},
6767
"scripts": {
6868
"build": "vite build",
69+
"dev": "vite --config vite.playground.config.ts",
6970
"build:dev": "vite build --mode development",
7071
"build:watch": "vite build --watch --mode production",
7172
"build:types": "vue-tsc --emitDeclarationOnly -p tsconfig.types.json",
@@ -169,6 +170,7 @@
169170
"vite": "^5.2.12",
170171
"vite-plugin-externalize-deps": "^0.8.0",
171172
"vue": "^3.4.27",
173+
"vite-tsconfig-paths": "^4.3.2",
172174
"vue-loader": "^17.4.2",
173175
"vue-tsc": "^2.0.19"
174176
},

src/App.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
<script setup lang="ts">
22
3+
import LibInput from "./components/LibInput/LibInput.vue"
34
import TestWrapper from "./TestWrapper.vue"
45
</script>
56

67
<template>
78
<test-wrapper>
8-
<lib-simple-input/>
9+
<!-- <lib-input/> -->
910
</test-wrapper>
1011
</template>
1112

vite.playground.config.ts

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
import vue from "@vitejs/plugin-vue"
2+
import { defineConfig } from "vite"
3+
import tsconfigPaths from "vite-tsconfig-paths"
4+
5+
import postcss from "./postcss.config.js"
6+
7+
8+
// https://vitejs.dev/config/
9+
export default async ({ mode }: { mode: string }) => defineConfig({
10+
plugins: [
11+
tsconfigPaths(),
12+
vue({
13+
script: {
14+
defineModel: true,
15+
},
16+
}),
17+
],
18+
// base: `/${pkg.name}/demo`,
19+
build: {
20+
outDir: "playground",
21+
...(mode === "production" ? {
22+
minify: true,
23+
} : {
24+
minify: false,
25+
sourcemap: "inline",
26+
}),
27+
},
28+
server: {
29+
// for locally linked repos when using vite server (i.e. not needed for libraries)
30+
fs: {
31+
allow: [...(process.env.CODE_PROJECTS ?? [])!],
32+
},
33+
watch: {
34+
35+
// for pnpm
36+
followSymlinks: true,
37+
// watch changes in linked repos
38+
ignored: ["!**/node_modules/@alanscodelog/**"],
39+
},
40+
},
41+
css: {
42+
postcss,
43+
},
44+
})

0 commit comments

Comments
 (0)