I'd wish to build my TypeScript project (in Visual Studio) with the following automated steps:
.ts
file as an AMD module, separately.js
file with webpack, into release/my-app.js
As part of step 1, .d.ts
files are also created for each .ts
file (in addition to the output Javascript files). How may I bundle these definition files together as well, so that they provide type definitions for what gets 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'
}
}
You could try https://www.npmjs.com/package/dts-bundle, but this is experimental and it does not work well with awesome-typescript-loader.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With