Created
June 16, 2020 12:41
-
-
Save sunnyone/fff31675ed4ead757ace09933d9e02f1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const ForkTsCheckerWebpackPlugin = require("fork-ts-checker-webpack-plugin"); | |
const path = require("path"); | |
const glob = require("glob"); | |
module.exports = { | |
target: "node", | |
entry: Object.fromEntries( | |
glob.sync("*/*.ts", {cwd: "src/ts/functions"}) | |
.map((x) => [x.replace(/\.ts$/, ""), `./src/ts/functions/${x}`])), | |
output: { | |
filename: "[name].js", | |
path: path.resolve(__dirname, "build/functions"), | |
libraryTarget: "commonjs2", | |
}, | |
module: { | |
rules: [ | |
{ | |
test: /\.ts$/, | |
exclude: /node_modules/, | |
use: [{loader: "ts-loader"}], | |
}, | |
], | |
}, | |
externals: ["aws-sdk"], | |
resolve: { | |
extensions: [".ts"], | |
}, | |
plugins: [new ForkTsCheckerWebpackPlugin({eslint: {files: "./src/ts/**/*"}})], | |
optimization: {minimize: false}, | |
devtool: "source-map", | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment