Giter VIP home page Giter VIP logo

Comments (9)

christostatitzikidis avatar christostatitzikidis commented on August 15, 2024 1

All seems to be working fine now :). Please close.

from angular-universal.

christostatitzikidis avatar christostatitzikidis commented on August 15, 2024

does not work: loadChildren: () => import('./modules/container.modules/home.container.module/home.container.module').then(m => m.HomeContainerModule)

works: loadChildren: './modules/container.modules/home.container.module/home.container.module#HomeContainerModule'

from angular-universal.

enten avatar enten commented on August 15, 2024

Did you update to angular 8?

Because it's a new feature (check angular realease 8 blog post).

from angular-universal.

christostatitzikidis avatar christostatitzikidis commented on August 15, 2024

Yes what I mean is that when LoadChildren uses the new dynamic import syntax the module is not lazy loaded but is included in the main module. For example the welcome module in the starter kit is not lazy loaded any more.

from angular-universal.

christostatitzikidis avatar christostatitzikidis commented on August 15, 2024

When I compile the same code (dynamic imports) without the UDK several modules are created (both for ES2015 and ES5). When I compile with the UDK I get one big main.js file. If I don’t use the dynamic imports I get modules but not two separate ones for es5/es2015. Also they are a lot larger than the ones made by the angular compiler without UDK.

from angular-universal.

enten avatar enten commented on August 15, 2024

@christostatitzikidis
My bad. I made a mistake in the workspace tsconfig.json.
I will push a commit to fix that.

diff --git a/tsconfig.json b/tsconfig.json
index ef44e28..607415f 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -5,10 +5,11 @@
     "outDir": "./dist/out-tsc",
     "sourceMap": true,
     "declaration": false,
+    "module": "esnext",
     "moduleResolution": "node",
     "emitDecoratorMetadata": true,
     "experimentalDecorators": true,
-    "target": "es5",
+    "target": "es2015",
     "typeRoots": [
       "node_modules/@types"
     ],

from angular-universal.

enten avatar enten commented on August 15, 2024

@christostatitzikidis
Can you try to fetch update or apply the patch and tells us if lazy route as import works again?

from angular-universal.

christostatitzikidis avatar christostatitzikidis commented on August 15, 2024

Yes, it works on this repository :) thanks! I'll try it tomorrow at work on the project I'm working on (40+ lazy loaded modules) and let you know if I find any other issues. Good job and thanks btw, been using this for a good while and now it seems to be even better with supporting HRM on lazy routes. Thanks again for the quick response and fix!

from angular-universal.

enten avatar enten commented on August 15, 2024

@christostatitzikidis

40+ lazy loaded modules

Waw! And everything building in the same universal compilation?

I'm waiting that you test at your work before close this issue :)

from angular-universal.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.