Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/ssigwart/webpack-typescript-directory-compile-plugin

Webpack plugin to take a source directory of typescript files and compile them to a destination directory of javascript files.
https://github.com/ssigwart/webpack-typescript-directory-compile-plugin

Last synced: about 2 months ago
JSON representation

Webpack plugin to take a source directory of typescript files and compile them to a destination directory of javascript files.

Awesome Lists containing this project

README

        

This Webpack plugin takes a source directory of typescript files and compiles them to a destination directory.

## Including Package
```bash
npm install @ssigwart/webpack-typescript-directory-compile-plugin --save-dev
```

## Example Usage

```js
const path = require('path');
const { TypescriptDirectoryCompileWebpackPlugin } = require('@ssigwart/webpack-typescript-directory-compile-plugin');

const tsDirCompilePlugin = new TypescriptDirectoryCompileWebpackPlugin(path.resolve(__dirname, "./ts/web"), path.resolve(__dirname, "www/js"));

module.exports = {
entry: tsDirCompilePlugin.getEntry(),
output: {
path: tsDirCompilePlugin.getOutputPath(),
filename: "[name].js",
},
resolve: {
extensions: [".ts"],
},
module: {
rules: [
{ test: /\.ts$/, loader: "ts-loader" },
],
},
plugins: [
tsDirCompilePlugin
]
};
```