Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upfeat: webpack plugin to support AoT natively #2333
Conversation
googlebot
commented
Sep 24, 2016
|
We found a Contributor License Agreement for you (the sender of this pull request) and all commit authors, but as best as we can tell these commits were authored by someone else. If that's the case, please add them to this pull request and have them confirm that they're okay with these commits being contributed to Google. If we're mistaken and you did author these commits, just reply here to confirm. |
|
Both @robwormald and I are Google employees and therefore agree to the CLA. |
| this.lazyRoutes = lazyModules.reduce((lazyRoutes: any, lazyModule: any) => { | ||
| lazyRoutes[`${lazyModule}.ngfactory`] = path.join( | ||
| path.resolve(process.cwd(), this.angularCompilerOptions.genDir), | ||
| 'app', lazyModule + '.ngfactory.ts' |
This comment has been minimized.
This comment has been minimized.
robwormald
Sep 26, 2016
Contributor
i realized this is hardcoded and would fail for anything other than app - should be I guess the relative path between the ngfactory directory and the app's root.
This comment has been minimized.
This comment has been minimized.
2be135e
to
d6fbf39
|
|
||
| // Super simple TS transpiler loader for testing / isolated usage. does not type check! | ||
| export function ngcLoader(source: string) { | ||
| const plugin = this._compilation._ngToolsWebpackPluginInstance as NgcWebpackPlugin; |
This comment has been minimized.
This comment has been minimized.
TheLarkInn
Sep 27, 2016
Member
This may be fine for now and once we drop webpack v2. I'm not sure when we are going to start giving deprecation warnings though for trying to access _compilation.
cc @sokra when he gets back from vacation. Maybe we need to have a way to supress warnings of these deprecations of this._compilation being unavailable from loaders on a per-plugin basis. That way this usage is acceptable for now, but in the future we can tail it off.
This comment has been minimized.
This comment has been minimized.
hansl
Sep 27, 2016
Author
Contributor
I really want to make a point that we need access to compilation in many cases, inside the loaders.
This comment has been minimized.
This comment has been minimized.
|
Of course the regex but you said you were going to get to that. |
| { test: /\.scss$/, loaders: ['raw-loader', 'sass-loader'] }, | ||
| { test: /\.css$/, loader: 'raw-loader' }, | ||
| { test: /\.html$/, loader: 'raw-loader' }, | ||
| { test: /\.ts$/, loader: '@ngtools/webpack' } |
This comment has been minimized.
This comment has been minimized.
TheLarkInn
Sep 28, 2016
Member
We thinking about changing name of loader for the future? Not really worried but I'm sure theres some post merge
This comment has been minimized.
This comment has been minimized.
TheLarkInn
Sep 28, 2016
Member
I guess since this is the test app, its really not a big deal at all.
This comment has been minimized.
This comment has been minimized.
hansl
Sep 28, 2016
Author
Contributor
I'm not thinking of changing it, but we could. What were you thikning of?
This comment has been minimized.
This comment has been minimized.
|
|
|
You guys are killing it! Looking forward to this very much |
Also adding a new package, webpack, which is a plugin and loader for webpack that adds support for AoT. It is behind a `--aot` flag in the CLI that is supported by build and serve.
googlebot
commented
Sep 28, 2016
|
CLAs look good, thanks! |
ginsleepy
commented
Sep 29, 2016
|
Does this work with lazy loading? it is not generating chunk.js file either. Also I cannot find any class related to the Module in main.bundle.js |
rolandoldengarm
commented
Sep 29, 2016
|
How would I use this? There's no documentation in the commits as far as I can see? |
shprink
commented
Sep 29, 2016
|
@rolandoldengarm use |
Also adding a new package, webpack, which is a plugin and loader for webpack that adds support for AoT. It is behind a `--aot` flag in the CLI that is supported by build and serve.
Also adding a new package, webpack, which is a plugin and loader for webpack that adds support for AoT. It is behind a `--aot` flag in the CLI that is supported by build and serve.
fkolar
commented
Oct 6, 2016
|
While looking at this push: d296778 Does it mean it will be offically supported in the next version of Angular-cli version 17? Unless somebody wants to pull master ? thanks, |
achimha
commented
Oct 9, 2016
|
Is there any documentation available? I've been trying to get it to work for some time now. It doesn't build my lazily loaded routes and complains about the ngfactory files not found. Are there any changes for bootstrapping the app? |
|
@achimha all changes needed should be done in memory. We don't yet have documentation but basically you can use the |
angular-automatic-lock-bot
bot
commented
Sep 10, 2019
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
hansl commentedSep 24, 2016
No description provided.