Skip to content
This repository was archived by the owner on Jan 9, 2022. It is now read-only.

Commit 09f2a74

Browse files
committed
feat: setup demo build and deploy
1 parent bfe28e5 commit 09f2a74

File tree

8 files changed

+176
-137
lines changed

8 files changed

+176
-137
lines changed

demo/deploy.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/usr/bin/env sh
2+
3+
set -e
4+
yarn run build
5+
cd dist
6+
git init
7+
git add -A
8+
git commit -m 'deploy'
9+
git push -f https://github.com/MichaelGitArt/gitart-vue-dialog.git master:gh-pages
10+
cd -

demo/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@
55
"dev": "vite",
66
"build": "vue-tsc --noEmit && vite build"
77
},
8+
"license": "MIT",
89
"dependencies": {
9-
"vue": "^3.0.5"
10+
"gitart-vue-dialog": "^0.0.12",
11+
"vue": "3.2.0-beta.7"
1012
},
1113
"devDependencies": {
1214
"@vitejs/plugin-vue": "^1.3.0",

demo/src/components/Dialogs/BaseDialog/BaseDialog.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
<script lang="ts">
1919
import { ref, defineComponent } from 'vue'
20-
import { GDialog } from 'plugin/index.js'
20+
import { GDialog } from 'plugin'
2121
2222
import { useModelWrapper } from '@/composables/modelWrapper'
2323

demo/src/components/Dialogs/StyledDialog/StyledDialog.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
<script lang="ts">
2626
import { defineComponent } from 'vue'
27-
import { GDialog } from 'plugin/index.js'
27+
import { GDialog } from 'plugin'
2828
2929
import { useModelWrapper } from '@/composables/modelWrapper'
3030

demo/src/scss/main.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
@import 'plugin/style.css'
1+
@import 'plugin-css'

demo/tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
"baseUrl": ".",
1313
"paths": {
1414
"@/*": ["./src/*"],
15-
"plugin/*": ["../dist/*"],
15+
"plugin": ["../dist/index"],
16+
"plugin-css": ["../dist/style.css"]
1617
}
1718
},
1819
"include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue"]

demo/vite.config.ts

Lines changed: 35 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,41 @@ import { defineConfig } from 'vite'
33
import vue from '@vitejs/plugin-vue'
44
import WindiCSS from 'vite-plugin-windicss'
55

6-
export default ({ mode }: { mode: 'production'| 'development' }) => defineConfig({
7-
base: mode === 'production'
8-
? '/gitart-vue-dialog/'
9-
: '/',
6+
export default ({ mode }: { mode: 'production'| 'development' }) => {
7+
const dialogPlugin = mode === 'development'
8+
? path.resolve(__dirname, '../dist/index.js')
9+
: 'gitart-vue-dialog'
1010

11-
plugins: [
12-
vue(),
13-
WindiCSS(),
14-
],
15-
server: {
16-
fs: {
17-
strict: false,
18-
allow: ['../'],
11+
const dialogPluginCss = mode === 'development'
12+
? path.resolve(__dirname, '../dist/style.css')
13+
: 'gitart-vue-dialog/dist/style.css'
14+
15+
return defineConfig({
16+
base: mode === 'production'
17+
? '/gitart-vue-dialog/'
18+
: '/',
19+
20+
plugins: [
21+
vue(),
22+
WindiCSS(),
23+
],
24+
25+
server: {
26+
fs: {
27+
strict: false,
28+
allow: [path.resolve(__dirname, '../')],
29+
},
1930
},
20-
},
21-
resolve: {
22-
alias: {
23-
'@': path.resolve(__dirname, '/src'),
24-
'plugin': path.resolve(__dirname, '../dist'),
31+
32+
resolve: {
33+
alias: {
34+
'@': path.resolve(__dirname, '/src'),
35+
'plugin': dialogPlugin,
36+
'plugin-css': dialogPluginCss,
37+
},
38+
},
39+
40+
build: {
41+
sourcemap: true,
2542
},
26-
},
27-
})
43+
})}

0 commit comments

Comments
 (0)