-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
35 lines (31 loc) · 1.01 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
const path = require('node:path');
const ACTIONS = {
GET_BUILD_TARGET_FULLPATHS: 'get-build-target-fullpaths',
ADD_DEPLOY_PATH_TO_README: 'add-deploy-path-to-readme-based-on-path',
MOVE_BUILD_OUTPUT: 'move-build-output-to-parent-directory',
BUILD_BY_PATH: 'build-by-path',
};
const getActionSrc = (action) => resolve(`src/actions/${action}/index.js`);
module.exports = {
entry: {
// [경로/파일명]: 번들링할 파일 위치
[ACTIONS.ADD_DEPLOY_PATH_TO_README]: getActionSrc(
ACTIONS.ADD_DEPLOY_PATH_TO_README
),
[ACTIONS.GET_BUILD_TARGET_FULLPATHS]: getActionSrc(
ACTIONS.GET_BUILD_TARGET_FULLPATHS
),
[ACTIONS.MOVE_BUILD_OUTPUT]: getActionSrc(ACTIONS.MOVE_BUILD_OUTPUT),
[ACTIONS.BUILD_BY_PATH]: getActionSrc(ACTIONS.BUILD_BY_PATH),
},
output: {
path: path.resolve(__dirname, './dist'),
filename: '[name].js',
clean: true,
},
target: 'node',
devtool: 'inline-source-map',
};
function resolve(...paths) {
return path.resolve(__dirname, ...paths);
}