fix(build): full bundle transform error (#3504)

- Prevent transformer to transform @element-plus/icons
This commit is contained in:
jeremywu 2021-09-19 20:23:00 +08:00 committed by GitHub
parent 2322103059
commit ccaddca6b4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -8,11 +8,11 @@ export default function entryPlugin(): Plugin {
if (id.includes('packages')) {
return {
code: code.replace(
/@element-plus\//g,
/@element-plus\/(components|directives|utils|hooks|tokens|locale)/g,
`${path.relative(
path.dirname(id),
path.resolve(__dirname, '../packages')
)}/`
)}/$1`
),
map: null,
}