This repository was archived by the owner on Jan 26, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.main.config.js
More file actions
62 lines (59 loc) · 1.76 KB
/
webpack.main.config.js
File metadata and controls
62 lines (59 loc) · 1.76 KB
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
56
57
58
59
60
61
const plugins = require('./webpack.plugins');
const CopyWebpackPlugin = require("copy-webpack-plugin")
const path = require("path")
const webpack = require('webpack');
const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin');
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
const assets = ["assets"]
const shouldAnalyze = process.argv.includes("--analyze")
module.exports = {
/**
* This is the main entry point for your application, it's the first file
* that runs in the main process.
*/
entry: './src/index.ts',
// Put your normal webpack config below here
module: {
rules: require('./webpack.rules'),
},
node: {
__dirname: false,
},
plugins: [
shouldAnalyze && new BundleAnalyzerPlugin({
analyzerPort: "auto"
}),
new webpack.DefinePlugin({
'process.env.FLUENTFFMPEG_COV': false
}),
new CopyWebpackPlugin({
patterns: [
...assets.map(asset => {
return {
from: path.resolve(__dirname, "src", asset, "main"),
to: path.resolve(__dirname, ".webpack/main", asset)
}
}),
{
from: path.resolve(__dirname, "node_modules", "@streamlabs", "game_overlay", "npm"),
to: path.resolve(__dirname, ".webpack/main")
},
{
from: path.resolve(__dirname, "node_modules", "node-global-key-listener", "bin"),
to: path.resolve(__dirname, ".webpack/main/key-listener")
}
]
}),
...plugins
].filter(e => e),
resolve: {
extensions: ['.js', '.ts', '.jsx', '.tsx', '.css', '.json'],
plugins: [
new TsconfigPathsPlugin({})
]
},
devtool: "source-map",
externals: {
"@streamlabs/obs-studio-node": "@streamlabs/obs-studio-node"
}
};