build: 서버별 build가 다를 가능성 고려

This commit is contained in:
2021-09-09 00:32:42 +09:00
parent 538615a1f5
commit c70181132f
2 changed files with 47 additions and 31 deletions
+32
View File
@@ -0,0 +1,32 @@
{
"ingame": {
"chiefCenter": "chiefCenter.ts",
"common": "common_deprecated.ts",
"troop": "troop.ts",
"map": "map.ts",
"install_db": "install_db.ts",
"install": "install.ts",
"battle_simulator": "battle_simulator.ts",
"recent_map": "recent_map.ts",
"processing": "processing.ts",
"select_npc": "select_npc.ts",
"betting": "betting.ts",
"bossInfo": "bossInfo.ts",
"myPage": "myPage.ts",
"extExpandCity": "extExpandCity.ts",
"main": "main.ts",
"dipcenter": "dipcenter.ts",
"diplomacy": "diplomacy.ts",
"currentCity": "currentCity.ts",
"hallOfFame": "hallOfFame.ts",
"history": "history.ts",
"join": "join.ts",
"select_general_from_pool": "select_general_from_pool.ts",
"extKingdoms": "extKingdoms.ts"
},
"ingame_vue": {
"v_inheritPoint": "v_inheritPoint.ts",
"v_board": "v_board.ts",
"v_NPCControl": "v_NPCControl.ts"
}
}
+15 -31
View File
@@ -10,6 +10,19 @@ module.exports = (env, argv) => {
const target = env.target ?? 'hwe';
const mode = argv.mode ?? 'production';
const tsDir = resolve(__dirname, `${target}/ts/`);
const build_exports = require(`${tsDir}/build_exports.json`);
//서버마다 ts 파일 구성이 다를 가능성이 높기 때문에 어떤 파일이 필요한지는 ts/build_exports.json을 확인한다.
const entryIngameVue = {};
for (const [entry, filePath] of Object.entries(build_exports.ingame_vue) ?? []) {
entryIngameVue[entry] = `${tsDir}/${filePath}`;
}
const entryIngame = {};
for (const [entry, filePath] of Object.entries(build_exports.ingame) ?? []) {
entryIngame[entry] = `${tsDir}/${filePath}`;
}
const ingame_vue = {
name: `ingame_${target}_vue`,
resolve: {
@@ -19,12 +32,7 @@ module.exports = (env, argv) => {
}
},
mode,
entry: {
v_inheritPoint: `${tsDir}/v_inheritPoint.ts`,
v_board: `${tsDir}/v_board.ts`,
v_NPCControl: `${tsDir}/v_NPCControl.ts`,
},
entry: entryIngameVue,
output: {
filename: '[name].js',
path: resolve(__dirname, `${target}/dist_js`)
@@ -169,31 +177,7 @@ module.exports = (env, argv) => {
extensions: [".js", ".ts", ".tsx"],
},
mode,
entry: {
chiefCenter: `${tsDir}/chiefCenter.ts`,
common: `${tsDir}/common_deprecated.ts`,
troop: `${tsDir}/troop.ts`,
map: `${tsDir}/map.ts`,
install_db: `${tsDir}/install_db.ts`,
install: `${tsDir}/install.ts`,
battle_simulator: `${tsDir}/battle_simulator.ts`,
recent_map: `${tsDir}/recent_map.ts`,
processing: `${tsDir}/processing.ts`,
select_npc: `${tsDir}/select_npc.ts`,
betting: `${tsDir}/betting.ts`,
bossInfo: `${tsDir}/bossInfo.ts`,
myPage: `${tsDir}/myPage.ts`,
extExpandCity: `${tsDir}/extExpandCity.ts`,
main: `${tsDir}/main.ts`,
dipcenter: `${tsDir}/dipcenter.ts`,
diplomacy: `${tsDir}/diplomacy.ts`,
currentCity: `${tsDir}/currentCity.ts`,
hallOfFame: `${tsDir}/hallOfFame.ts`,
history: `${tsDir}/history.ts`,
join: `${tsDir}/join.ts`,
select_general_from_pool: `${tsDir}/select_general_from_pool.ts`,
extKingdoms: `${tsDir}/extKingdoms.ts`,
},
entry: entryIngame,
output: {
filename: '[name].js',
path: resolve(__dirname, `${target}/dist_js`)