mirror of
https://gitee.com/element-plus/element-plus.git
synced 2024-12-04 20:27:44 +08:00
f868d9afa3
* feat: add full bundle locale * refactor: build
23 lines
582 B
TypeScript
23 lines
582 B
TypeScript
import { EP_PKG, EP_PREFIX } from '../utils/constants'
|
|
import type { Plugin } from 'rollup'
|
|
|
|
export function ElementPlusAlias(): Plugin {
|
|
const THEME_CHALK = `${EP_PREFIX}/theme-chalk`
|
|
|
|
return {
|
|
name: 'element-plus-alias-plugin',
|
|
resolveId(id, importer, options) {
|
|
if (!id.startsWith(EP_PREFIX)) return
|
|
|
|
if (id.startsWith(THEME_CHALK)) {
|
|
return {
|
|
id: id.replaceAll(THEME_CHALK, `${EP_PKG}/theme-chalk`),
|
|
external: 'absolute',
|
|
}
|
|
}
|
|
|
|
return this.resolve(id, importer, { skipSelf: true, ...options })
|
|
},
|
|
}
|
|
}
|