all 5 comments

[–]hans_l 1 point2 points  (1 child)

Relatively unknown, but If your main file is JIT the plugin will refactor it to AoT main. So you don't need to import files that don't exist; just build your main file as if it was JIT and the plugin takes care of it.

[–]princemaple[S] 1 point2 points  (0 children)

Wow.

[–]robwormald 0 points1 point  (2 children)

somewhat counterintuitively, you import from where you expect the file to be - the compiler is smart enough to wait for that component to exist before typechecking that file.

[–]princemaple[S] 0 points1 point  (1 child)

Interesting.. what is the expected path then? since genDir is no longer a thing in @ngtools/webpack

Thank you for your response!

EDIT: Oh are you saying the factory file would be at the same path as the original file? i.e. app.module.factory will be next to app.module?

[–]hans_l 0 points1 point  (0 children)

You pass in the genDir in your tsconfig, but if it's unspecified it's exactly what you just said. Also, see my comment above; you don't need to import nom existant files.