-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathwebpack.config.babel.js
48 lines (46 loc) · 1.09 KB
/
webpack.config.babel.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import path from "path";
import Webpack from "webpack";
import Dotenv from "dotenv-webpack";
const myPath = "./functions/rekognize/";
module.exports = {
entry: myPath + "src/index.js",
target: "node",
mode: "production",
plugins: [
new Webpack.NoEmitOnErrorsPlugin(),
new Dotenv({ path: "../../.env.production" }),
new Dotenv({ path: "../../.env.local" }),
new Dotenv({ path: "../../.env" }),
],
output: {
path: path.join(process.cwd(), myPath, "built"),
filename: "index.js",
libraryTarget: "commonjs2",
},
externals: ["aws-sdk"],
module: {
rules: [
{
test: /\.js$/,
loader: "babel-loader",
options: {
cacheDirectory: true,
babelrc: false,
presets: [
"stage-0",
[
"env",
{
targets: { node: "8.10" },
useBuiltIns: false,
debug: false,
},
],
],
plugins: ["transform-runtime"],
},
exclude: [{ and: [/node_modules/] }],
},
],
},
};