angular-aot

Configuring angular production files after build

放肆的年华 提交于 2021-02-11 13:50:22
问题 I have an angular 9 project which is part of an application suite installer [Wix installer]. One of the settings used by the angular app is the address of API which it fetches its data from some configurable address. I know that I can have many angular environment files and simply use commands such as the followings: environment.env1.ts export const environment = { production: true, apiAddress: "http://apiAddress1/api/", }; ng build --prod --configuration=env1 or environment.env2.ts export

Differences between Angular compilations

时间秒杀一切 提交于 2020-08-09 17:51:07
问题 When I compile my app with ng build --prod I have this error ERROR in : Cannot determine the module for class AppComponent in D:/desarrollos/PatientPortal/front/src/app/customizations/database/app.component-database.ts! Add AppComponent to the NgModule to fix it. but if it compile with ng build --configuration=prod It's compile ok and my app works ok. I see the difference is the first one is compile with the AOT option, but I don't know why have this error, and don't know if it is important

Using both AOT and JIT in production within an Angular 9 app

依然范特西╮ 提交于 2020-04-10 11:56:28
问题 So I have been building an Angular 9 app where there is a customer dashboard to manage their templates which are saved on the server. Those templates can be viewed on different devices through an activation system so the devices are bound to the user. So lets say on https://templates.com we have /login , /dashboards , /manage with sub paths from viewing and editing data. On this url we also have /:companyName on this path it requests a template, that contains html with interpolation strings,

_lazy_route_resource lazy namespace object

北战南征 提交于 2020-01-02 01:31:07
问题 I'm using angular compiler: const AngularCompilerPlugin = require('@ngtools/webpack').AngularCompilerPlugin; With these compiler options: "angularCompilerOptions": { "genDir": "./build/compiled", "outDir": "./build/compiled", "skipMetadataEmit": true, "debug": true}, Relevant part of my package.json is: "@ngtools/webpack": "^6.0.0", "@angular/router": "^5.2.0", "webpack": "4.8.3", "webpack-cli": "2.1.4", And my angularCompilerPlugin config is: new AngularCompilerPlugin({ tsConfigPath: 'path

main-aot is missing from the typeScript compilation

有些话、适合烂在心里 提交于 2019-12-13 17:24:47
问题 I am trying to implement ngc compilation config on my angular/webpack app. I have a tsConfig-aot.json in my root folder like below. { .... "files": [ "src/app/app.module.ts", "src/app/lazy/about/about.module.ts", "src/app/lazy/employees/employees.module.ts", "src/app/lazy/login/login.module.ts", "src/app/lazy/employee-details/employee-details.module.ts" ], "include": [ "src/polyfills.ts", "src/vendor.ts" ], "exclude": [ "./node_modules", "./**/*.e2e.ts", "./**/*.spec.ts", "./src/main-aot.ts"

Angular AOT compilation error "cannot determine module for class Component''

我只是一个虾纸丫 提交于 2019-12-03 15:33:43
问题 I have an Angular (4.3.2) application on which I want to perform an AOT build. App was created using @angular/cli . I have two components scaffolded with ng generate and a module in which both are included as a declaration: import {PrivateComponent} from './private.component/private.component'; NgModule({ imports: [ // other imports PrivateRoutingModule ], declarations: [ ...some other components, PrivateComponent, AppTopBarComponent ] // other stuff }) export class PrivateModule {} Private

Angular 5 webpack 3 aot

↘锁芯ラ 提交于 2019-12-03 09:34:45
问题 I'm trying to make an aot build with webpack 3 and angular 5, but there are so many tutorials on the net and none show complete example without questions, so far I've got the following configuration: (For those who have questions about paths - I use it in the java app) webpack.config.aot.js: const webpack = require("webpack"); const ExtractTextPlugin = require("extract-text-webpack-plugin"); const ngToolsWebpack = require('@ngtools/webpack'); module.exports = { context: __dirname + "/src/main

Angular AOT compilation error \"cannot determine module for class Component''

只愿长相守 提交于 2019-12-03 06:00:43
I have an Angular (4.3.2) application on which I want to perform an AOT build. App was created using @angular/cli . I have two components scaffolded with ng generate and a module in which both are included as a declaration: import {PrivateComponent} from './private.component/private.component'; NgModule({ imports: [ // other imports PrivateRoutingModule ], declarations: [ ...some other components, PrivateComponent, AppTopBarComponent ] // other stuff }) export class PrivateModule {} Private component is also used in the module's routing: const routes: Routes = [ {path: '', component:

Angular 5 webpack 3 aot

爱⌒轻易说出口 提交于 2019-12-03 01:07:57
I'm trying to make an aot build with webpack 3 and angular 5, but there are so many tutorials on the net and none show complete example without questions, so far I've got the following configuration: (For those who have questions about paths - I use it in the java app) webpack.config.aot.js: const webpack = require("webpack"); const ExtractTextPlugin = require("extract-text-webpack-plugin"); const ngToolsWebpack = require('@ngtools/webpack'); module.exports = { context: __dirname + "/src/main/webapp/resources/script/", entry: { app: "./core/main.aot.ts", vendor: "./vendor.ts", polyfills: ".

angular AOT and JIT on same project

◇◆丶佛笑我妖孽 提交于 2019-11-30 03:02:51
问题 On angular5, i try to have on same project AOT compilation for most of my module/component... but i have one part who need to be JIT compiled. For this second part, HTML come from Ajax request and contain some component tag who must be compiled by angular. To Manage this part i use directive who looks like : export class ArticleLiveDirective implements OnInit, OnChanges, OnDestroy { // [...] constructor( private container: ViewContainerRef, private compiler: Compiler ) { } // [...] private