Skip to content

Commit

Permalink
fix: mode error
Browse files Browse the repository at this point in the history
  • Loading branch information
wiidede committed Feb 22, 2024
1 parent aee4a2e commit 2496c77
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@
],
"scripts": {
"build": "vite build",
"dev": "vite playground",
"dev:pkg": "vite playground --mode pkg",
"dev": "vite playground --mode play",
"dev:pkg": "vite playground",
"preview": "vite preview playground",
"build:play": "vite build playground",
"lint": "eslint .",
Expand Down
14 changes: 8 additions & 6 deletions playground/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import Inspect from 'vite-plugin-inspect'
import Component from 'unplugin-vue-components/vite'
import { VueRangeMultiResolver } from '../src/resolver'

export default defineConfig({
export default defineConfig(({ mode }) => ({
plugins: [
Vue(),
Component({
Expand All @@ -17,14 +17,16 @@ export default defineConfig({
{
name: 'blank',
load(id) {
if (id.endsWith('vue-range-multi/style.css'))
if (mode === 'play' && id.endsWith('vue-range-multi/style.css'))
return ''
},
},
],
resolve: {
alias: [
{ find: /^vue-range-multi$/, replacement: path.resolve(__dirname, '../src/index.ts') },
],
alias: mode === 'play'
? [
{ find: /^vue-range-multi$/, replacement: path.resolve(__dirname, '../src/index.ts') },
]
: [],
},
})
}))

0 comments on commit 2496c77

Please sign in to comment.