Is it possible to prevent imported libraries from being included in my result bundle? Consider the following code snippet:
import * as angular from 'angular';
const app = angular.module('app',[]);
And let's take a look at the build task below.
function buildTs(compileOptions) {
browserify(compileOptions)
.plugin(tsify, tsconfig.compileOptions)
.bundle()
.pipe(source('bundle.js'))
.pipe(gulp.dest(path.dest.js));
}
Upon completion of the build process, Angular library gets included in bundle.js. Is there a way to avoid this?
This is my tsConfig file:
{
"compilerOptions": {
"target": "ES5",
"module": "commonjs",
"noImplicitAny": false,
"removeComments": true,
"sourceMap": true,
"types": [
"angular",
"angular-cookies",
"angular-ui-bootstrap",
"angular-ui-router",
"jasmine",
"angular-mocks"
]
},
"include": [
"app"
],
"exclude": [
"node_modules"
]
}
No luck with removing types from tsConfig either :)