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

How Do I enable AOT ? #2772

Open
koraysels opened this issue Nov 5, 2018 · 2 comments
Open

How Do I enable AOT ? #2772

koraysels opened this issue Nov 5, 2018 · 2 comments

Comments

@koraysels
Copy link

@koraysels koraysels commented Nov 5, 2018

  • I understand that GitHub issues are not for tech support, but for questions specific to this generator, bug reports, and feature requests.
Item Version
generator-angular-fullstack 5.0.0-rc.4
Node v10.6.0
npm 6.1.0
Operating System OS X 10
etc etc
Item Answer
Transpiler TypeScript
Markup HTML
CSS SCSS
Router ngRoute
Client Tests Jasmine / Mocha
DB MongoDB
Auth Y
etc etc

How Do I enable AOT and optimize ? Also is there an easy way to update to angular 7 ?

@LuisFlip
Copy link

@LuisFlip LuisFlip commented Dec 20, 2018

@Awk34 The project is build in jit or aot?
if is in jit, how i build project with AOT?

@LuisFlip
Copy link

@LuisFlip LuisFlip commented Feb 7, 2019

Hello,
for enable AOT i install:
"@angular/cli": "^6.2.9",
"@angular/compiler-cli": "^6.1.10",
"@ngtools/webpack": "^1.10.2",
in webpack.make.js:
config.module = { rules: [ { test: /(\.ngfactory\.js|\.ngstyle\.js|\.ts)$/, loader: '@ngtools/webpack' }, .......

config.plugins = [ new AngularCompilerPlugin({ tsConfigPath: './tsconfig.json', mainPath: './client/app/app', entryModule: './client/app/app.module#AppModule', sourceMap: true, skipCodeGeneration: BUILD ? false : true }),......
i replace ALL components templates and styles
example:
template: require('./home') to templateUrl: './home'
styles: [require('./main.scss')] to styleUrls: ['./main.scss'],

this code enable AOT only in production mode, in development mode use JIT.

PS: if doesn't work, combines the packages versions.

I used Angular 6.0.4 and it works. i hope this help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.