build: fix component version error (#3528)

This commit is contained in:
gimmyhehe 2025-06-23 14:08:46 +08:00 committed by GitHub
parent 40e69c46e1
commit 3aed708b89
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 2 deletions

View File

@ -259,7 +259,7 @@ export const getBaseConfig = ({ vueVersion, dtsInclude, dts, buildTarget, isRunt
} }
} }
}), }),
!isRuntime && replaceModuleNamePlugin(versionTarget) !isRuntime && replaceModuleNamePlugin(() => versionTarget)
], ],
resolve: { resolve: {
extensions: ['.js', '.ts', '.tsx', '.vue'], extensions: ['.js', '.ts', '.tsx', '.vue'],

View File

@ -1,6 +1,7 @@
import type { Plugin, NormalizedOutputOptions, OutputBundle } from 'rollup' import type { Plugin, NormalizedOutputOptions, OutputBundle } from 'rollup'
export default function (version: string): Plugin { export default function (getVersion: () => string): Plugin {
const version = getVersion()
return { return {
name: 'opentiny-vue:replace-module-name', name: 'opentiny-vue:replace-module-name',
generateBundle: (output: NormalizedOutputOptions, bundle: OutputBundle) => { generateBundle: (output: NormalizedOutputOptions, bundle: OutputBundle) => {