Skip to content

Commit

Permalink
Publish lib and demo separately
Browse files Browse the repository at this point in the history
  • Loading branch information
pfumagalli committed Nov 6, 2024
1 parent 9b3e390 commit 543ae36
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ jobs:
- name: Build Pages
run: |
npm clean-install
npm run build
npm run build-demo
env:
VITE_BASE_URL: "${{steps.setup.outputs.base_url}}"

- name: Upload Pages Artifact
uses: actions/upload-pages-artifact@v3
with:
path: dist
path: demo

- name: Deploy Pages
uses: actions/deploy-pages@v4
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@
"./style.css": "./dist/style.css"
},
"scripts": {
"build": "npm run check && vite build --mode=demo && vite build --mode=production",
"build": "npm run check && vite build",
"build-demo": "npm run check && vite build --mode=demo",
"build-lib": "npm run check && vite build --mode=production",
"check": "vue-tsc --build --force && vitest run --coverage && eslint",
"deploy-dev": "wrangler deploy",
"deploy-prod": "wrangler deploy --env=production",
Expand Down
14 changes: 10 additions & 4 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,17 @@ import { defineConfig } from 'vitest/config'

export default defineConfig((env) => {
const demo = env.mode === 'demo'
return defineConfig({
plugins: [ vue(), svg(), dts({

const plugins = [ vue(), svg() ]
if (! demo) {
plugins.push(dts({
tsconfigPath: './tsconfig.app.json',
rollupTypes: true,
}) ],
rollupTypes: ! demo,
}))
}

return defineConfig({
plugins,
build: {
minify: true,
sourcemap: true,
Expand Down

0 comments on commit 543ae36

Please sign in to comment.