Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ bazel_dep(name = "aspect_rules_jasmine", version = "2.0.0")
bazel_dep(name = "rules_angular")
git_override(
module_name = "rules_angular",
commit = "2c348bf59a38d044f4d389290d597d94c0699607",
remote = "https://github.com/devversion/rules_angular.git",
commit = "ef03084730381448cf6cd6d1778b5a5c5f9e1958",
remote = "https://github.com/alan-agius4/rules_angular.git",
)

bazel_dep(name = "devinfra")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"outDir": "./dist/out-tsc",
"sourceMap": true,
"declaration": false,
"moduleResolution": "node",
"moduleResolution": "bundler",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"skipLibCheck": true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ describeBuilder(buildApplication, APPLICATION_BUILDER_INFO, (harness) => {
// Enable tsconfig resolveJsonModule option in tsconfig
await harness.modifyFile('tsconfig.json', (content) => {
const tsconfig = JSON.parse(content);
tsconfig.compilerOptions.moduleResolution = 'node';
tsconfig.compilerOptions.resolveJsonModule = true;

return JSON.stringify(tsconfig);
Expand All @@ -43,6 +44,7 @@ describeBuilder(buildApplication, APPLICATION_BUILDER_INFO, (harness) => {
// Enable tsconfig resolveJsonModule option in tsconfig
await harness.modifyFile('tsconfig.json', (content) => {
const tsconfig = JSON.parse(content);
tsconfig.compilerOptions.moduleResolution = 'node';
tsconfig.compilerOptions.resolveJsonModule = undefined;

return JSON.stringify(tsconfig);
Expand Down Expand Up @@ -71,6 +73,7 @@ describeBuilder(buildApplication, APPLICATION_BUILDER_INFO, (harness) => {
// Enable tsconfig resolveJsonModule option in tsconfig
await harness.modifyFile('tsconfig.json', (content) => {
const tsconfig = JSON.parse(content);
tsconfig.compilerOptions.moduleResolution = 'node';
tsconfig.compilerOptions.resolveJsonModule = false;

return JSON.stringify(tsconfig);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ describeKarmaBuilder(execute, KARMA_BUILDER_INFO, (harness, setupTarget) => {

await harness.modifyFile('src/tsconfig.spec.json', (content) => {
const tsConfig = JSON.parse(content);
tsConfig.compilerOptions.moduleResolution = 'node';
tsConfig.compilerOptions.module = 'commonjs';

return JSON.stringify(tsConfig);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import type {
AngularAppEngine as SSRAngularAppEngine,
ɵgetOrCreateAngularServerApp as getOrCreateAngularServerApp,
} from '@angular/ssr';
import type * as AngularSsrNode from '@angular/ssr/node' with { 'resolution-mode': 'import' };
import type { ServerResponse } from 'node:http';
import type { Connect, ViteDevServer } from 'vite';
import { loadEsmModule } from '../../../utils/load-esm';
Expand Down Expand Up @@ -38,7 +39,7 @@ export function createAngularSsrInternalMiddleware(
// which must be processed by the runtime linker, even if they are not used.
await loadEsmModule('@angular/compiler');
const { writeResponseToNodeResponse, createWebRequestFromNodeRequest } =
await loadEsmModule<typeof import('@angular/ssr/node')>('@angular/ssr/node');
await loadEsmModule<typeof AngularSsrNode>('@angular/ssr/node');

const { ɵgetOrCreateAngularServerApp } = (await server.ssrLoadModule('/main.server.mjs')) as {
ɵgetOrCreateAngularServerApp: typeof getOrCreateAngularServerApp;
Expand Down Expand Up @@ -93,7 +94,7 @@ export async function createAngularSsrExternalMiddleware(
await loadEsmModule('@angular/compiler');

const { createWebRequestFromNodeRequest, writeResponseToNodeResponse } =
await loadEsmModule<typeof import('@angular/ssr/node')>('@angular/ssr/node');
await loadEsmModule<typeof AngularSsrNode>('@angular/ssr/node');

return function angularSsrExternalMiddleware(
req: Connect.IncomingMessage,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
* found in the LICENSE file at https://angular.dev/license
*/

import type * as AngularSsrNode from '@angular/ssr/node' with { 'resolution-mode': 'import' };
import assert from 'node:assert';
import { createServer } from 'node:http';
import { loadEsmModule } from '../load-esm';
Expand All @@ -22,7 +23,7 @@ export const DEFAULT_URL = new URL('http://ng-localhost/');
export async function launchServer(): Promise<URL> {
const { reqHandler } = await loadEsmModuleFromMemory('./server.mjs');
const { createWebRequestFromNodeRequest, writeResponseToNodeResponse } =
await loadEsmModule<typeof import('@angular/ssr/node')>('@angular/ssr/node');
await loadEsmModule<typeof AngularSsrNode>('@angular/ssr/node');

if (!isSsrNodeRequestHandler(reqHandler) && !isSsrRequestHandler(reqHandler)) {
return DEFAULT_URL;
Expand Down
2 changes: 1 addition & 1 deletion packages/angular/build/src/utils/server-rendering/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/

import type { createRequestHandler } from '@angular/ssr';
import type { createNodeRequestHandler } from '@angular/ssr/node';
import type { createNodeRequestHandler } from '@angular/ssr/node' with { 'resolution-mode': 'import' };

export function isSsrNodeRequestHandler(
value: unknown,
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,7 @@ export default function (): Rule {
rootJson.modify(['compilerOptions', 'esModuleInterop'], true);
rootJson.modify(['compilerOptions', 'downlevelIteration'], undefined);
rootJson.modify(['compilerOptions', 'allowSyntheticDefaultImports'], undefined);
rootJson.modify(['compilerOptions', 'moduleResolution'], 'bundler');
}),
]);
}