As I venture into the realm of Webpack, I am faced with the challenge of transitioning from TypeScript 1.x to TypeScript 2. In my previous projects, I typically worked with TypeScript in one module using separate files, TSD for typings, and compiling through a Gulp task.
Currently, I am working on a new project where I am configuring a Webpack + TypeScript 2 setup with imports and @types for typings. While making progress, I am encountering an issue with excluding certain libraries from my webpack bundle.
The directory structure of my project is as follows:
components/
customComponentA/
customComponentB/
node_modules/
@types/
angular/
main.ts
tsconfig.json
webpack.config.js
Whenever I include
import * as angular from "angular";
in my custom components, I encounter 'Can't resolve 'angular'' errors (which is expected). Once I add 'angular' to my node_modules, Webpack is content, but then Angular ends up being included in my final bundle.
I am striving for a solution where my typings are resolved without including Angular in the final bundle. Is there a way to achieve this?