豆豆友情提示:这是一个非官方 GitHub 代理镜像,主要用于网络测试或访问加速。请勿在此进行登录、注册或处理任何敏感信息。进行这些操作请务必访问官方网站 github.com。 Raw 内容也通过此代理提供。
Skip to content

Commit bc7bf8b

Browse files
committed
feat(shared-scripts): support only running linker on subset of files
This can help up speeding builds as we wouldn't setup Babel if the linker is not needed for certain files.
1 parent fc8badf commit bc7bf8b

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

shared-scripts/angular-optimization/esbuild-plugin.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
export interface OptimizationOptions {
1010
enableLinker?: {
1111
ensureNoPartialDeclaration: boolean;
12+
filterPaths?: RegExp;
1213
linkerOptions?: object;
1314
};
1415
optimize?: {

shared-scripts/angular-optimization/esbuild-plugin.mjs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,11 @@ export async function createEsbuildAngularOptimizePlugin(opts, additionalBabelPl
8787
}
8888
}
8989

90-
if (opts.enableLinker) {
90+
const shouldRunLinker =
91+
opts.enableLinker &&
92+
(opts.enableLinker.filterPaths == null || opts.enableLinker.filterPaths.test(args.path));
93+
94+
if (shouldRunLinker) {
9195
plugins.push(
9296
linkerCreator.babel.createEs2015LinkerPlugin({
9397
...(opts.enableLinker.linkerOptions ?? {}),

0 commit comments

Comments
 (0)