fix(angular): setup-ssr environments file replacements should be removed (#13244)
This commit is contained in:
parent
e041223020
commit
b88dc35aa5
@ -9,12 +9,6 @@ Object {
|
||||
"sourceMap": true,
|
||||
},
|
||||
"production": Object {
|
||||
"fileReplacements": Array [
|
||||
Object {
|
||||
"replace": "apps/app1/src/environments/environment.ts",
|
||||
"with": "apps/app1/src/environments/environment.prod.ts",
|
||||
},
|
||||
],
|
||||
"outputHashing": "media",
|
||||
},
|
||||
},
|
||||
|
||||
@ -7,13 +7,5 @@
|
||||
*/
|
||||
import '@angular/platform-server/init';
|
||||
|
||||
import { enableProdMode } from '@angular/core';
|
||||
|
||||
import { environment } from './environments/environment';
|
||||
|
||||
if (environment.production) {
|
||||
enableProdMode();
|
||||
}
|
||||
|
||||
export { <%= rootModuleClassName %> } from './app/<%= rootModuleFileName.slice(0, -3) %>';
|
||||
export { renderModule } from '@angular/platform-server';
|
||||
@ -1,12 +1,6 @@
|
||||
import { enableProdMode } from '@angular/core';
|
||||
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
|
||||
|
||||
import { AppModule } from './app/app.module';
|
||||
import { environment } from './environments/environment';
|
||||
|
||||
if (environment.production) {
|
||||
enableProdMode();
|
||||
}
|
||||
|
||||
function bootstrap() {
|
||||
platformBrowserDynamic()
|
||||
|
||||
@ -21,18 +21,6 @@ export function updateProjectConfig(tree: Tree, schema: Schema) {
|
||||
configurations: {
|
||||
production: {
|
||||
outputHashing: 'media',
|
||||
fileReplacements: [
|
||||
{
|
||||
replace: joinPathFragments(
|
||||
projectConfig.sourceRoot,
|
||||
'environments/environment.ts'
|
||||
),
|
||||
with: joinPathFragments(
|
||||
projectConfig.sourceRoot,
|
||||
'environments/environment.prod.ts'
|
||||
),
|
||||
},
|
||||
],
|
||||
},
|
||||
development: {
|
||||
optimization: false,
|
||||
|
||||
@ -34,27 +34,13 @@ describe('setupSSR', () => {
|
||||
*/
|
||||
import '@angular/platform-server/init';
|
||||
|
||||
import { enableProdMode } from '@angular/core';
|
||||
|
||||
import { environment } from './environments/environment';
|
||||
|
||||
if (environment.production) {
|
||||
enableProdMode();
|
||||
}
|
||||
|
||||
export { AppServerModule } from './app/app.server.module';
|
||||
export { renderModule } from '@angular/platform-server';"
|
||||
`);
|
||||
expect(tree.read('apps/app1/src/main.ts', 'utf-8')).toMatchInlineSnapshot(`
|
||||
"import { enableProdMode } from '@angular/core';
|
||||
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
|
||||
"import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
|
||||
|
||||
import { AppModule } from './app/app.module';
|
||||
import { environment } from './environments/environment';
|
||||
|
||||
if (environment.production) {
|
||||
enableProdMode();
|
||||
}
|
||||
|
||||
function bootstrap() {
|
||||
platformBrowserDynamic()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user