forked from chrismaltby/gb-studio
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.cli.config.js
55 lines (53 loc) · 1.4 KB
/
webpack.cli.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
53
54
55
/* eslint-disable @typescript-eslint/no-var-requires */
const plugins = require("./webpack.plugins");
const Path = require("path");
const webpack = require("webpack");
const srcPath = (subdir) => {
return Path.join(__dirname, "src", subdir);
};
module.exports = {
target: "electron-main",
mode: "development",
/**
* This is the main entry point for your application, it's the first file
* that runs in the main process.
*/
node: {
__dirname: false,
__filename: false,
},
entry: {
index: Path.resolve(__dirname, "./src/bin/gb-studio-cli.ts"),
buildWorker: "./src/lib/compiler/buildWorker.ts",
},
output: {
filename: (pathData) => {
if (pathData.chunk.name === "index") {
return "gb-studio-cli.js";
}
return "[name].js";
},
path: Path.resolve(__dirname, "./out/cli"),
publicPath: __dirname,
},
// Put your normal webpack config below here
module: {
rules: require("./webpack.rules"),
},
plugins: [].concat(
plugins,
new webpack.BannerPlugin({ banner: "#!/usr/bin/env node", raw: true })
),
resolve: {
extensions: [".js", ".ts", ".jsx", ".tsx", ".css"],
alias: {
store: srcPath("store"),
components: srcPath("components"),
lang: srcPath("lang"),
lib: srcPath("lib"),
ui: srcPath("components/ui"),
shared: srcPath("shared"),
consts: srcPath("consts.ts"),
},
},
};