Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(angular): use the correct output path for mf ssr #18849 #18906

Merged
merged 1 commit into from
Aug 30, 2023
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
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ import { AppServerModule } from './bootstrap.server';
// The Express app is exported so that it can be used by serverless Functions.
export function app(): express.Express {
const server = express();
const browserBundles = join(process.cwd(), 'dist/apps/test/browser');
const browserBundles = join(process.cwd(), 'dist/test/browser');

server.use(cors());
const indexHtml = existsSync(join(browserBundles, 'index.original.html'))
Expand Down Expand Up @@ -223,7 +223,7 @@ import bootstrap from './bootstrap.server';
// The Express app is exported so that it can be used by serverless Functions.
export function app(): express.Express {
const server = express();
const browserBundles = join(process.cwd(), 'dist/apps/test/browser');
const browserBundles = join(process.cwd(), 'dist/test/browser');

server.use(cors());
const indexHtml = existsSync(join(browserBundles, 'index.original.html'))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import<% if(standalone) { %> bootstrap <% } else { %> { AppServerModule } <% } %
// The Express app is exported so that it can be used by serverless Functions.
export function app(): express.Express {
const server = express();
const browserBundles = join(process.cwd(), 'dist/apps/<%= appName %>/browser');
const browserBundles = join(process.cwd(), '<%= browserBundleOutput %>');

server.use(cors());
const indexHtml = existsSync(join(browserBundles, 'index.original.html'))
Expand Down
6 changes: 6 additions & 0 deletions packages/angular/src/generators/host/lib/add-ssr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,14 @@ export async function addSsr(tree: Tree, options: Schema, appName: string) {
"import('./src/main.server');"
);

const browserBundleOutput = joinPathFragments(
project.targets.build.options.outputPath,
'browser'
);

generateFiles(tree, join(__dirname, '../files'), project.root, {
appName,
browserBundleOutput,
standalone: options.standalone,
tmpl: '',
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ import { AppServerModule } from './bootstrap.server';
// The Express app is exported so that it can be used by serverless Functions.
export function app(): express.Express {
const server = express();
const browserBundles = join(process.cwd(), 'dist/apps/test/browser');
const serverBundles = join(process.cwd(), 'dist/apps/test/server');
const browserBundles = join(process.cwd(), 'dist/test/browser');
const serverBundles = join(process.cwd(), 'dist/test/server');

server.use(cors());
const indexHtml = existsSync(join(browserBundles, 'index.original.html'))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import<% if(standalone) { %> bootstrap <% } else { %> { AppServerModule } <% } %
// The Express app is exported so that it can be used by serverless Functions.
export function app(): express.Express {
const server = express();
const browserBundles = join(process.cwd(), 'dist/apps/<%= appName %>/browser');
const serverBundles = join(process.cwd(), 'dist/apps/<%= appName %>/server');
const browserBundles = join(process.cwd(), '<%= browserBundleOutput %>');
const serverBundles = join(process.cwd(), '<%= serverBundleOutput %>');

server.use(cors());
const indexHtml = existsSync(join(browserBundles, 'index.original.html'))
Expand Down
11 changes: 11 additions & 0 deletions packages/angular/src/generators/remote/lib/add-ssr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,23 @@ export async function addSsr(
"import('./src/main.server');"
);

const browserBundleOutput = joinPathFragments(
project.targets.build.options.outputPath,
'browser'
);
const serverBundleOutput = joinPathFragments(
project.targets.build.options.outputPath,
'server'
);

generateFiles(
tree,
joinPathFragments(__dirname, '../files/base'),
project.root,
{
appName,
browserBundleOutput,
serverBundleOutput,
standalone,
tmpl: '',
}
Expand Down