Skip to content
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

gulp-typescript: noExternalResolve is deprecated - use noResolve instead #646

Open
Manoj-Chakladar opened this issue Mar 31, 2020 · 1 comment

Comments

@Manoj-Chakladar
Copy link

Expected behavior: When I run gulp compile command the SRC folder in lambda should compile all TS file's and create a new folder DIST having all the compiled files in JS format from SRC folder.

Actual behavior:
When I run gulp compile command i get the following warning:
gulp-typescript: noExternalResolve is deprecated - use noResolve instead
The non-standard option noExternalResolve has been removed as of gulp-typescript 3.0.
Use noResolve instead.
error TS5023: Unknown compiler option 'exclude'.

Your gulpfile:
///
var gulp = require('gulp');
var ts = require('gulp-typescript');
var zip = require('gulp-zip');
var del = require('del');
var install = require('gulp-install');
var runSequence = require('run-sequence');
var awsLambda = require("node-aws-lambda");
var sourcemaps = require('gulp-sourcemaps');
var gulpMocha = require('gulp-mocha');
var gutil = require('gulp-util');

const babel = require('gulp-babel');
gulp.task('clean', function () {
return del(['./dist','./testJs', './dist.zip']);
});

gulp.task('compile', function () {
return gulp.src(['src//*.ts' ]) //'typings//.d.ts'])
.pipe(sourcemaps.init())
.pipe(ts({
noImplicitAny: true,
removeComments: true,
preserveConstEnums: true,
target: 'es2015',
module: 'commonjs',
noExternalResolve: true,
exclude: ["node_modules", "dist"]
}))
.pipe(babel({
presets: [ 'es2015' ],
plugins: ['transform-runtime']
}))
.pipe(sourcemaps.write('.', { sourceRoot: '../src' }))
.pipe(gulp.dest('./dist'))
,
gulp.src(['src/**/
.json'])
.pipe(gulp.dest('./dist'));
});

gulp.task('node-mods', function () {
return gulp.src('./package.json')
.pipe(gulp.dest('dist/'))
.pipe(install({ production: true }));
});

gulp.task('zip', function () {
return gulp.src(['dist/**/', '!dist/package.json', '!dist/.map'])
.pipe(zip('1033_RMSG_MRDR.zip'))
.pipe(gulp.dest('./dist/zip/'));
});

gulp.task('deploy', function (callback) {
return runSequence(
'clean',
'compile',
'compiletest',
'test',
'node-mods',
callback
);
});

gulp.task('compiletest', function () {
return gulp.src(['test//*.ts' ]) //'typings//*.d.ts'])
.pipe(sourcemaps.init())
.pipe(ts({
noImplicitAny: true,
removeComments: true,
preserveConstEnums: true,
target: 'es2015',
module: 'commonjs',
noExternalResolve: true,
exclude: ["node_modules", "testJs"]
}))
.pipe(babel({
presets: [ 'es2015' ],
plugins: ['transform-runtime']
}))
.pipe(sourcemaps.write('.', { sourceRoot: '../test' }))
.pipe(gulp.dest('./testJs'));
});

gulp.task('test', function(){
return gulp.src(['testJS/**/*.js'],{read:false})
.pipe(gulpMocha({reporter:'list'}))
.on('error', gutil.log);
})

tsconfig.json
{
"compilerOptions": {
"module": "commonjs",
"removeComments": true,
"preserveConstEnums": true,
"noImplicitAny": false,
"skipLibCheck": true,
"target": "es2015"
},
"exclude": ["node_modules", "dist"]
}

I am new to gulp and AWS lambda , please kindly help. Also the gulp compile command executes with 47 semantic errors. All of error code: TS7006 i.e Parameter xyz implicitly has an 'any' type

@Manoj-Chakladar
Copy link
Author

This is the end message:
TypeScript: 47 semantic errors
TypeScript: emit succeeded (with errors)
(node:10592) UnhandledPromiseRejectionWarning: Error: TypeScript: Compilation failed
at Output.mightFinish (C:\Users\manoj.k.chakladar\Downloads\My Tasks\Secret manager retrieval\cost collector\1033_PRD_RMSG_CostCollector\node_modules\gulp-typescript\release\output.js:130:43)
at applySourceMap.then.appliedSourceMap (C:\Users\manoj.k.chakladar\Downloads\My Tasks\Secret manager retrieval\cost collector\1033_PRD_RMSG_CostCollector\node_modules\gulp-typescript\release\output.js:43:22)
(node:10592) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise
which was not handled with .catch(). (rejection id: 3)
(node:10592) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero
exit code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant