Skip to content

Commit 543ae36

Browse files
committed
Publish lib and demo separately
1 parent 9b3e390 commit 543ae36

File tree

3 files changed

+13
-8
lines changed

3 files changed

+13
-8
lines changed

.github/workflows/publish.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,14 @@ jobs:
2727
- name: Build Pages
2828
run: |
2929
npm clean-install
30-
npm run build
30+
npm run build-demo
3131
env:
3232
VITE_BASE_URL: "${{steps.setup.outputs.base_url}}"
3333

3434
- name: Upload Pages Artifact
3535
uses: actions/upload-pages-artifact@v3
3636
with:
37-
path: dist
37+
path: demo
3838

3939
- name: Deploy Pages
4040
uses: actions/deploy-pages@v4

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,8 @@
1010
"./style.css": "./dist/style.css"
1111
},
1212
"scripts": {
13-
"build": "npm run check && vite build --mode=demo && vite build --mode=production",
13+
"build": "npm run check && vite build",
1414
"build-demo": "npm run check && vite build --mode=demo",
15-
"build-lib": "npm run check && vite build --mode=production",
1615
"check": "vue-tsc --build --force && vitest run --coverage && eslint",
1716
"deploy-dev": "wrangler deploy",
1817
"deploy-prod": "wrangler deploy --env=production",

vite.config.ts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,17 @@ import { defineConfig } from 'vitest/config'
55

66
export default defineConfig((env) => {
77
const demo = env.mode === 'demo'
8-
return defineConfig({
9-
plugins: [ vue(), svg(), dts({
8+
9+
const plugins = [ vue(), svg() ]
10+
if (! demo) {
11+
plugins.push(dts({
1012
tsconfigPath: './tsconfig.app.json',
11-
rollupTypes: true,
12-
}) ],
13+
rollupTypes: ! demo,
14+
}))
15+
}
16+
17+
return defineConfig({
18+
plugins,
1319
build: {
1420
minify: true,
1521
sourcemap: true,

0 commit comments

Comments
 (0)