-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwebpack.config.js
52 lines (52 loc) · 1.15 KB
/
webpack.config.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
49
50
51
52
const path = require("path");
const GasPlugin = require("gas-webpack-plugin");
const Es3ifyPlugin = require("es3ify-webpack-plugin");
const glob = require("glob");
const entries = {};
glob.sync("./**/*.ts", {
cwd: "./src/gas"
}).map((fileName) => {
entries[fileName] = path.resolve("./src/gas", fileName);
});
console.log(entries)
module.exports = {
mode: "development",
devtool: "inline-source-map",
context: __dirname,
entry: entries,
output: {
path: path.resolve(__dirname, "dist"),
filename: '[name].js',
},
resolve: {
extensions: [".ts", ".js"],
},
module: {
rules: [
{
test: /\.[tj]s$/,
loader: "babel-loader",
},
{
test: /\.(yml)$/i,
use: [
{
loader: "file-loader",
options: {
name: "[name].[ext]"
}
}
]
},
],
},
plugins: [new GasPlugin(), new Es3ifyPlugin()],
resolve: {
extensions: [".ts", ".json"],
alias: {
"@utils": path.resolve(__dirname, "./src/utils"),
"@src": path.resolve(__dirname, "./src"),
"@root": path.resolve(__dirname, "./"),
},
},
};