我有一个Angular 4应用程序,并尝试升级到6。在构建applin之前进行升级之前,在构建过程中突然出现很多错误。我只是用gulpfile来构建。
这是错误:
The following options have been renamed — please update your config: entry -> input, format -> output.format
'rxjs/Rx' is imported by build\services\alerts\alert.service.js, but could not be resolved – treating it as an external dependency
'rxjs/Observable' is imported by build\services\alerts\alert.service.js, but could not be resolved – treating it as an external dependency
'rxjs/add/operator/catch' is imported by build\services\alerts\alert.service.js, but could not be resolved – treating it as an external dependency
这是gulpfile.js中的代码块:
gulp.task('rollup:fesm', function () {
return gulp.src(`${buildFolder}/**/*.js`)
// transform the files here.
.pipe(rollup({
// Bundle's entry point
// See https://github.com/rollup/rollup/wiki/JavaScript-API#entry
entry: `${buildFolder}/index.js`,
// Allow mixing of hypothetical and actual files. "Actual" files can be files
// accessed by Rollup or produced by plugins further down the chain.
// This prevents errors like: 'path/file' does not exist in the hypothetical file system
// when subdirectories are used in the `src` directory.
allowRealFiles: true,
// A list of IDs of modules that should remain external to the bundle
// See https://github.com/rollup/rollup/wiki/JavaScript-API#external
external: [
'@angular/core',
'@angular/common',
'@angular/http',
'@angular/forms',
'@angular/router',
'primeng/primeng'
],
// Format of generated bundle
// See https://github.com/rollup/rollup/wiki/JavaScript-API#format
format: 'es'
}))
.pipe(gulp.dest(distFolder));
});
我可以知道为什么突然出现这些错误吗?我唯一要做的就是将节点版本升级到6.11