Skip to content

Commit bdef398

Browse files
ms-dosx86dgp1130
authored andcommittedJul 17, 2024·
fix(@angular/build): resolve only ".wasm" files
(cherry picked from commit 855a4b8)
1 parent 7cafee5 commit bdef398

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed
 

‎packages/angular/build/src/tools/esbuild/wasm-plugin.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export function createWasmPlugin(options: WasmPluginOptions): Plugin {
4646
return {
4747
name: 'angular-wasm',
4848
setup(build): void {
49-
build.onResolve({ filter: /.wasm$/ }, async (args) => {
49+
build.onResolve({ filter: /\.wasm$/ }, async (args) => {
5050
// Skip if already resolving the WASM file to avoid infinite resolution
5151
if (args.pluginData?.[WASM_RESOLVE_SYMBOL]) {
5252
return;
@@ -94,7 +94,7 @@ export function createWasmPlugin(options: WasmPluginOptions): Plugin {
9494
});
9595

9696
build.onLoad(
97-
{ filter: /.wasm$/, namespace: WASM_INIT_NAMESPACE },
97+
{ filter: /\.wasm$/, namespace: WASM_INIT_NAMESPACE },
9898
createCachedLoad(cache, async (args) => {
9999
// Ensure async mode is supported
100100
if (!allowAsync) {
@@ -194,7 +194,7 @@ export function createWasmPlugin(options: WasmPluginOptions): Plugin {
194194
}),
195195
);
196196

197-
build.onLoad({ filter: /.wasm$/, namespace: WASM_CONTENTS_NAMESPACE }, async (args) => {
197+
build.onLoad({ filter: /\.wasm$/, namespace: WASM_CONTENTS_NAMESPACE }, async (args) => {
198198
const contents = args.pluginData.wasmContents ?? (await readFile(args.path));
199199

200200
let loader: 'binary' | 'file' = 'file';

0 commit comments

Comments
 (0)
Please sign in to comment.