我在https://angular.io/guide/aot-compiler教程之后,一切顺利,直到汇总部分。
当我跑步时:
"node_modules/.bin/rollup" -c rollup-config.js
我收到了这些错误:
The following options have been renamed — please update your config: options.entry -> options.input, options.dest -> options.output.file, options.format -> options.output.format
src/main.ts → src/build.js...
The final argument to magicString.overwrite(...) should be an options object. See https://github.com/rich-harris/magic-string
[!] Error: Unexpected token
aot\src\app\app.module.ngfactory.ts (43:57)
41: import * as import32 from './all-holiday-requests/all-holiday-requests.component.ngfactory';
42: import * as import33 from '../../../src/app/app.component';
43: class AppModuleInjector extends import0.ɵNgModuleInjector<import1.AppModule> {
^
44: _NgProbeToken_2:any[];
45: _ɵg_3:import2.ɵg;
在此之前,我得到了这个:
The following options have been renamed — please update your config: options.entry -> options.input, options.dest -> options.output.file, options.format -> options.output.format
src/main.ts → src/build.js...
The final argument to magicString.overwrite(...) should be an options object. See https://github.com/rich-harris/magic-string
[!] Error: Could not resolve '../aot/src/app/app.module.ngfactory' from src\main.ts
Error: Could not resolve '../aot/src/app/app.module.ngfactory' from src\main.ts
at error (D:\DEV\mdAutocomplete - test\node_modules\rollup\dist\rollup.js:185:14)
at then.resolvedId (D:\DEV\mdAutocomplete - test\node_modules\rollup\dist\rollup.js:9776:8)
所以我改变了
main.ts
import { AppModuleNgFactory } from '../aot/src/app/app.module.ngfactory';
到
import { AppModuleNgFactory } from '../aot/src/app/app.module.ngfactory.ts';
也许这是一个错误。感谢提前帮助:)