Skip to content

Instantly share code, notes, and snippets.

@joaogolias
Created July 7, 2020 16:13
Show Gist options
  • Save joaogolias/63e4a2f4c7b57d82cedcded9b7ed1e0b to your computer and use it in GitHub Desktop.
Save joaogolias/63e4a2f4c7b57d82cedcded9b7ed1e0b to your computer and use it in GitHub Desktop.
Exemplo de arquivo de configuração do webpack para typescript
const path = require("path");
const slsw = require("serverless-webpack");
const nodeExternals = require("webpack-node-externals");
module.exports = {
entry: slsw.lib.entries,
module: {
rules: [
{
test: /\.ts$/,
loader: "ts-loader",
include: path.join(__dirname, "src"),
exclude: /node_modules/,
},
],
},
resolve: {
extensions: [".ts", ".js"],
},
output: {
libraryTarget: "commonjs2",
path: path.join(__dirname, ".webpack"),
filename: "[name].js",
},
externals: [nodeExternals()],
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment