greengerong / rebirth

GreenGerong(破狼) blog with Angular4.
https://greengerong.github.io/rebirth
MIT License
356 stars 118 forks source link

支持AOT编译 #11

Closed greengerong closed 7 years ago

greengerong commented 8 years ago

Use angular-cli tool to implement AOT without lazyload in branch: cli-aot-without-lazyload.

JimChenWYU commented 8 years ago

你好,破狼,为什么aot编译没有报错,然而会卡死在一个地方? 因为等待时间实在太长了,至今没有成功过。

greengerong commented 8 years ago

看这个branch的aot cli-aot-without-lazyload。目前angular-cli在aot在lazyload下还存在问题。

zrzs commented 7 years ago

拉取了 cli-aot-without-lazyload分支,还是编译报错,不知道是什么原因

greengerong commented 7 years ago

@hippylw 什么错误?我本地没错

zrzs commented 7 years ago

Cannot find module 'process-nextick-args'

greengerong commented 7 years ago

@hippylw 获取当前的master版本看看呢。 安装angular-cli@1.0.0-beta.21

需要注释掉nodde_modules/@ngtools/webpack/src/loader.js中的_removeDecorators方法:

function _removeDecorators(refactor) {
    // Find all decorators.
    // refactor.findAstNodes(refactor.sourceFile, ts.SyntaxKind.Decorator)
    //     .forEach(function (d) { return refactor.removeNode(d); });
}

这会移除自定义的装饰器,在下个版本cli将被修复

greengerong commented 7 years ago

AOT已经在master分支支持