-
Notifications
You must be signed in to change notification settings - Fork 1
/
webpack.functions.js
47 lines (46 loc) · 1.2 KB
/
webpack.functions.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
//This file is compiling the Azure functions which are located on top level
var webpack = require("webpack"),
glob = require("glob");
module.exports = {
mode: 'production',
devtool: false,
target: "node",
node: {
__dirname: true,
},
entry: glob.sync("*/index.ts").reduce((acc, value) => {
console.log(value)
acc[value.replace(/.ts$/, ".js")] = "./" + value; return acc;
}, {}),
output: {
path: process.cwd(),
filename: "[name]",
libraryTarget: "commonjs2"
},
resolve: {
extensions: [".ts", ".js", ".json"]
},
module: {
rules: [
{
test: /\.tsx?$/,
use: [{
loader: "ts-loader",
options: {
configFile: 'tsconfig.functions.json',
silent: true
}
}]
}, {
test: /\.json$/,
use: ['json-loader']
}
]
},
plugins: [
new webpack.DefinePlugin({ "global.GENTLY": false }),
new webpack.SourceMapDevToolPlugin({
filename: '[name].map'
})
]
};