File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
packages/vite-plugin-uni/src/configResolved/plugins Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change 11import path from 'path'
22// import debug from 'debug'
3+ import fs from 'fs-extra'
34import type { Plugin } from 'vite'
45import { resolveBuiltIn , resolveUTSModule } from '@dcloudio/uni-cli-shared'
56
67import type { VitePluginUniResolvedOptions } from '../..'
78
89// const debugResolve = debug('uni:resolve-id')
910
11+ const isPiniaVersion3 =
12+ Number (
13+ fs
14+ . readJSONSync ( resolveBuiltIn ( path . join ( 'pinia/package.json' ) ) )
15+ . version . split ( '.' ) [ 0 ]
16+ ) >= 3
17+
1018const BUILT_IN_MODULES = {
1119 'vue-router' : 'dist/vue-router.esm-bundler.js' ,
1220 vuex : 'dist/vuex.esm-bundler.js' ,
@@ -17,7 +25,7 @@ const BUILT_IN_MODULES = {
1725 '@dcloudio/uni-shared' : 'dist/uni-shared.es.js' ,
1826 '@dcloudio/uni-stacktracey' : 'dist/uni-stacktracey.es.js' ,
1927 '@vue/shared' : 'dist/shared.esm-bundler.js' ,
20- pinia : 'dist/pinia.mjs' ,
28+ pinia : isPiniaVersion3 ? '' : 'dist/pinia.mjs' ,
2129}
2230
2331export type BuiltInModulesKey = keyof typeof BUILT_IN_MODULES
You can’t perform that action at this time.
0 commit comments