Created
July 7, 2020 16:13
-
-
Save joaogolias/63e4a2f4c7b57d82cedcded9b7ed1e0b to your computer and use it in GitHub Desktop.
Exemplo de arquivo de configuração do webpack para typescript
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 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