File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
packages/vite-plugin-uni/src/configResolved/plugins Expand file tree Collapse file tree 1 file changed +5
-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+ fs . readJSONSync ( resolveBuiltIn ( path . join ( 'pinia/package.json' ) ) ) . version > '3'
13+
1014const BUILT_IN_MODULES = {
1115 'vue-router' : 'dist/vue-router.esm-bundler.js' ,
1216 vuex : 'dist/vuex.esm-bundler.js' ,
@@ -17,7 +21,7 @@ const BUILT_IN_MODULES = {
1721 '@dcloudio/uni-shared' : 'dist/uni-shared.es.js' ,
1822 '@dcloudio/uni-stacktracey' : 'dist/uni-stacktracey.es.js' ,
1923 '@vue/shared' : 'dist/shared.esm-bundler.js' ,
20- pinia : 'dist/pinia.mjs' ,
24+ pinia : isPiniaVersion3 ? '' : 'dist/pinia.mjs' ,
2125}
2226
2327export type BuiltInModulesKey = keyof typeof BUILT_IN_MODULES
You can’t perform that action at this time.
0 commit comments