Skip to content

Commit f2a2e92

Browse files
clydindgp1130
authored andcommitted
fix(@angular-devkit/build-angular): provide Vite client code source map when loading
The sourcemap for the Vite client code was previously not being loaded along with the actual code. This could lead to browser 404 console messages when debugging applications. (cherry picked from commit e98dde6)
1 parent 9e7c47b commit f2a2e92

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

packages/angular_devkit/build_angular/src/tools/vite/angular-memory-plugin.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,16 @@ export function createAngularMemoryPlugin(options: AngularMemoryPluginOptions):
6868
return join(virtualProjectRoot, source);
6969
}
7070
},
71-
load(id) {
71+
async load(id) {
7272
const [file] = id.split('?', 1);
7373
const relativeFile = '/' + normalizePath(relative(virtualProjectRoot, file));
7474
const codeContents = outputFiles.get(relativeFile)?.contents;
7575
if (codeContents === undefined) {
7676
if (relativeFile.endsWith('/node_modules/vite/dist/client/client.mjs')) {
77-
return loadViteClientCode(file);
77+
return {
78+
code: await loadViteClientCode(file),
79+
map: await readFile(file + '.map', 'utf-8'),
80+
};
7881
}
7982

8083
return;

0 commit comments

Comments
 (0)