Skip to content

Commit 694c7a7

Browse files
committedFeb 17, 2025··
perf: dynamic import unplugins
1 parent 659b916 commit 694c7a7

File tree

3 files changed

+192
-196
lines changed

3 files changed

+192
-196
lines changed
 

‎package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
"pkg-types": "^1.3.1",
6363
"publint": "^0.3.5",
6464
"rolldown": "^1.0.0-beta.3",
65-
"rollup": "^4.34.7",
65+
"rollup": "^4.34.8",
6666
"rollup-plugin-dts": "^6.1.1",
6767
"tinyglobby": "^0.2.10",
6868
"unconfig": "^7.0.0",

‎pnpm-lock.yaml

+186-191
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎src/index.ts

+5-4
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ import process from 'node:process'
33
import { fileURLToPath } from 'node:url'
44
import { build as rolldownBuild, type OutputOptions } from 'rolldown'
55
import { transformPlugin } from 'rolldown/experimental'
6-
import { IsolatedDecl } from 'unplugin-isolated-decl'
7-
import { Unused } from 'unplugin-unused'
86
import { cleanOutDir } from './features/clean'
97
import { bundleDts, getTempDtsDir } from './features/dts'
108
import { ExternalPlugin } from './features/external'
@@ -114,9 +112,12 @@ export async function buildSingle(
114112
plugins: [
115113
(pkg || resolved.skipNodeModulesBundle) &&
116114
ExternalPlugin(pkg, resolved.skipNodeModulesBundle),
117-
unused && Unused.rolldown(unused === true ? {} : unused),
115+
unused &&
116+
(await import('unplugin-unused')).Unused.rolldown(
117+
unused === true ? {} : unused,
118+
),
118119
dts &&
119-
IsolatedDecl.rolldown({
120+
(await import('unplugin-isolated-decl')).IsolatedDecl.rolldown({
120121
...dts,
121122
extraOutdir: resolved.bundleDts
122123
? getTempDtsDir(format)

0 commit comments

Comments
 (0)
Please sign in to comment.