-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathwebpack.config.js
33 lines (30 loc) · 1.29 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
import { resolve } from 'path';
const cd = import.meta.dirname;
/**
* @param {string} js The JS file to pack
* @returns {import('webpack').Configuration} */
function webpackConfig(js) {
return {
mode : 'production',
entry : resolve(cd, `./Client/Script/${js}.js`),
resolve : {
alias : {
ResultRow : resolve(cd, 'Client/Script/ResultRow/index.js'),
StickySettings : resolve(cd, 'Client/Script/StickySettings/index.js'),
ServerSettingsDialog : resolve(cd, 'Client/Script/ServerSettingsDialog/index.js'),
'/Shared/PlexTypes.js' : resolve(cd, 'Shared/PlexTypes.js'),
'/Shared/MarkerBreakdown.js' : resolve(cd, 'Shared/MarkerBreakdown.js'),
'/Shared/ServerConfig.js' : resolve(cd, 'Shared/ServerConfig.js'),
'/Shared/ConsoleLog.js' : resolve(cd, 'Shared/ConsoleLog.js'),
'/Shared/MarkerType.js' : resolve(cd, 'Shared/MarkerType.js'),
'/Shared/PostCommands.js' : resolve(cd, 'Shared/PostCommands.js'),
}
},
output : {
filename : `${js}.[contenthash].js`,
path : resolve(cd),
}
};
}
export const IndexJS = webpackConfig('index');
export const LoginJS = webpackConfig('login');