I have a problem with uglify main bundle.js file.
This is my gulp scripts:
gulp.task("compile", () => {
let tsResult = gulp.src("app/**/*.ts")
.pipe(sourcemaps.init())
.pipe(tsProject());
return tsResult.js
.pipe(sourcemaps.write(".", { sourceRoot: '/app' }))
.pipe(concat('bundle.js'))
.pipe(gulp.dest('app/_Dist/'));
});
gulp.task("minify", ["compile"], function () {
return gulp.src(['app/_Dist/bundle.js'])
.pipe(concat('bundle.min.js'))
.pipe(plumber())
.pipe(uglify())
.on('error', function (err) { gutil.log(gutil.colors.red('[Error]'), err.toString()); })
.pipe(plumber.stop())
.pipe(gulp.dest(outputLocation));
});
After running this scripts I catch next exception:
[15:16:20] [Error] GulpUglifyError: unable to minify JavaScript Caused by: SyntaxError: Unexpected token: punc (:) File: C:\Projects\AngGulpApp\app\_Dist\bundle.min.js Line: 1
tsconfig.json
{
"compileOnSave": true,
"compilerOptions": {
"target": "es5",
"module": "es2015",
"moduleResolution": "node",
"noEmitOnError": false,
"sourceMap": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"removeComments": false,
"noImplicitAny": false,
"lib": [ "es2015", "dom" ],
"baseUrl": ".",
"typeRoots": [
"node_modules/@types"
]
},
"exclude": [
"gulpfile.ts",
"node_modules"
]
}
I don't know how to resolve this problem. Any ideas how to resolve this problem?