Skip to content

Commit

Permalink
demos: fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
Priestch committed Oct 16, 2023
1 parent 0fe8819 commit 53d100c
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
push:
paths:
- docs/**
- examples/**
- demos/**
- .github/**

jobs:
Expand Down
40 changes: 21 additions & 19 deletions demos/vite.config.js
Original file line number Diff line number Diff line change
@@ -1,29 +1,31 @@
import { viteStaticCopy } from "vite-plugin-static-copy";
import { resolve } from "path";
import { fileURLToPath, URL } from "node:url";

import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";

// https://vitejs.dev/config/
export default defineConfig({
plugins: [
vue(),
viteStaticCopy({
targets: [
export default defineConfig(({ command, mode, ssrBuild }) => {
const base = command === "build" ? "/document-viewer/demos/" : "/";
return {
base,
plugins: [
vue(),
viteStaticCopy({
targets: [
{
src: "node_modules/@document-kits/viewer/dist/generic/*",
dest: "document-viewer",
},
],
}),
],
resolve: {
alias: [
{
src: "node_modules/@document-kits/viewer/dist/generic/*",
dest: "document-viewer",
find: /^canvas$/,
replacement: "canvas.js",
},
],
}),
],
resolve: {
alias: [
{
find: /^canvas$/,
replacement: "canvas.js",
},
],
},
},
};
});

0 comments on commit 53d100c

Please sign in to comment.