I want to automate the build process for my TypeScript project in Visual Studio by following these steps:
- Compile each
.ts
file as an AMD module individually - Use webpack to bundle each created
.js
file intorelease/my-app.js
During step 1, .d.ts
files are also generated for each .ts
file. How can I include these definition files so they provide type definitions for the content bundled into the my-app.js
output file?
Project Layout
MyApp
|-- lib
| |-- foo.ts
| |-- foo.js
| |-- foo.d.ts
| `-- ...
|-- release
| `-- my-app.js
|-- main.ts
|-- main.js
|-- main.d.ts
`-- webpack.config.js
webpack.config.js
module.exports = {
context: __dirname,
entry: './main.js',
output: {
path: path.join(__dirname, 'release'),
filename: 'my-app.js'
}
}