Skip to content

[Feat] Add @ngtools/webpack AoT option for outputting to fs instead of virtual file system. #3236

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

Closed
luchillo17 opened this issue Nov 22, 2016 · 6 comments
Assignees
Labels
P5 The team acknowledges the request but does not plan to address it, it remains open for discussion

Comments

@luchillo17
Copy link

This is a feature request, i have a webpack app, i need to config the webpack config file manually, so the feature i suggest is to allow the @ngtools/webpack AoT to output the app module factory to file system, maybe only the app module or every file (open to discussion).

Reason to propose feature

I keep getting error Module not found for the app module factory, and i don't know if it isn't being created, if i have it configured in a different folder or what, being able to flag the plugin to force it to output to file system, so we can see it in project file tree would help clarify this kind of issues.

Repro steps.

Check this repo branch: https://github.com/Luchillo/angular2-webpack-starter/tree/aot
Clone, checkout branch aot, npm install, npm run build:aot and the error should pop out.

The log given by the failure.

ERROR in ./src/main.aot.ts
Module not found: Error: Can't resolve './app.module.ngfactory' in '/Users/aplicaciones2/Documents/angular2-webpack-starter/src'
 @ ./src/main.aot.ts 10:29-62
@filipesilva filipesilva added P5 The team acknowledges the request but does not plan to address it, it remains open for discussion type: enhancement labels Dec 22, 2016
@hansl
Copy link
Contributor

hansl commented Dec 22, 2016

@Luchillo: I've never gotten this error without another error above which was the real source of the problem. Could you try to see if there was any other errors?

I'm not entirely sold on not having a virtual filesystem, since you can always run ngc yourself to get that. The webpack plugin simply run the same code as ngc but using an in memory host. So you can get the result of it yourself.

@luchillo17
Copy link
Author

It's just to make sure i'm setting the paths correctly, i'm not saying it shouldn't use virtual filesystem, i'm saying it should have the option to output to disk to debug potential path misconfiguration.

@luchillo17
Copy link
Author

@hansl Btw did you test with the repo branch i linked?, that's exactly the project i'm trying to put AoT support to work.

@luchillo17
Copy link
Author

luchillo17 commented Dec 27, 2016

I'm still trying to figure this out, here's how the error is shown to me:

image

The other error you mention might be that one about AppModule not being an NgModule?

I do think is a path misconfiguration, that's why i think it would be beneficial to output to fs to be able to debug this kind of bugs.

@filipesilva
Copy link
Contributor

Mostly superseded by #6203.

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
P5 The team acknowledges the request but does not plan to address it, it remains open for discussion
Projects
None yet
Development

No branches or pull requests

3 participants