Skip to content

Commit 2496c77

Browse files
committed
fix: mode error
1 parent aee4a2e commit 2496c77

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@
4040
],
4141
"scripts": {
4242
"build": "vite build",
43-
"dev": "vite playground",
44-
"dev:pkg": "vite playground --mode pkg",
43+
"dev": "vite playground --mode play",
44+
"dev:pkg": "vite playground",
4545
"preview": "vite preview playground",
4646
"build:play": "vite build playground",
4747
"lint": "eslint .",

playground/vite.config.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import Inspect from 'vite-plugin-inspect'
66
import Component from 'unplugin-vue-components/vite'
77
import { VueRangeMultiResolver } from '../src/resolver'
88

9-
export default defineConfig({
9+
export default defineConfig(({ mode }) => ({
1010
plugins: [
1111
Vue(),
1212
Component({
@@ -17,14 +17,16 @@ export default defineConfig({
1717
{
1818
name: 'blank',
1919
load(id) {
20-
if (id.endsWith('vue-range-multi/style.css'))
20+
if (mode === 'play' && id.endsWith('vue-range-multi/style.css'))
2121
return ''
2222
},
2323
},
2424
],
2525
resolve: {
26-
alias: [
27-
{ find: /^vue-range-multi$/, replacement: path.resolve(__dirname, '../src/index.ts') },
28-
],
26+
alias: mode === 'play'
27+
? [
28+
{ find: /^vue-range-multi$/, replacement: path.resolve(__dirname, '../src/index.ts') },
29+
]
30+
: [],
2931
},
30-
})
32+
}))

0 commit comments

Comments
 (0)