diff --git a/.babelrc b/.babelrc index 9f4b9828..c6e7c612 100644 --- a/.babelrc +++ b/.babelrc @@ -3,14 +3,7 @@ [ "@babel/preset-env", { - "targets": { - "browsers": [ - [ - "last 2 versions", - "ie >= 11" - ] - ] - }, + "targets": "> 0.2%, not ie>8, not op_mini all", "useBuiltIns": "usage", "corejs": 3, "modules": false @@ -18,7 +11,6 @@ ] ], "plugins": [ - "lodash", - "@babel/plugin-transform-runtime" + "lodash" ] } \ No newline at end of file diff --git a/hwe/a_bestGeneral.php b/hwe/a_bestGeneral.php index 3ea858d9..9e2efb34 100644 --- a/hwe/a_bestGeneral.php +++ b/hwe/a_bestGeneral.php @@ -29,9 +29,8 @@ $templates = new \League\Plates\Engine(__DIR__.'/templates'); - - - + + diff --git a/hwe/a_emperior.php b/hwe/a_emperior.php index 3f15f846..e2605728 100644 --- a/hwe/a_emperior.php +++ b/hwe/a_emperior.php @@ -16,8 +16,8 @@ increaseRefresh("왕조일람", 1); <?=UniqueConst::$serverName?>: 왕조일람 - - + + diff --git a/hwe/a_emperior_detail.php b/hwe/a_emperior_detail.php index 527da7de..4749b1b6 100644 --- a/hwe/a_emperior_detail.php +++ b/hwe/a_emperior_detail.php @@ -26,9 +26,6 @@ $serverID = $emperior['server_id']??($emperior['serverID']??null); <?=UniqueConst::$serverName?>: 왕조일람 - - - diff --git a/hwe/a_genList.php b/hwe/a_genList.php index 12d24685..585e3450 100644 --- a/hwe/a_genList.php +++ b/hwe/a_genList.php @@ -46,9 +46,8 @@ if($gameStor->isunited){ - - + diff --git a/hwe/a_hallOfFame.php b/hwe/a_hallOfFame.php index 9138f3d2..7799d034 100644 --- a/hwe/a_hallOfFame.php +++ b/hwe/a_hallOfFame.php @@ -50,11 +50,10 @@ else{ - - - - + + + diff --git a/hwe/a_history.php b/hwe/a_history.php index 042e4612..cd9d55b9 100644 --- a/hwe/a_history.php +++ b/hwe/a_history.php @@ -99,9 +99,8 @@ $nations = Json::decode($history['nations']); <?=UniqueConst::$serverName?>: 연감 - - + diff --git a/hwe/a_kingdomList.php b/hwe/a_kingdomList.php index e66abd87..af41c8b1 100644 --- a/hwe/a_kingdomList.php +++ b/hwe/a_kingdomList.php @@ -25,8 +25,8 @@ if($con >= 2) { printLimitMsg($me['turntime']); exit(); } <?=UniqueConst::$serverName?>: 세력일람 - - + + diff --git a/hwe/a_npcList.php b/hwe/a_npcList.php index b9ce4a15..94430720 100644 --- a/hwe/a_npcList.php +++ b/hwe/a_npcList.php @@ -26,8 +26,8 @@ $sel[$type] = "selected"; <?=UniqueConst::$serverName?>: 빙의일람 - - + + diff --git a/hwe/a_status.php b/hwe/a_status.php index 409be4d9..05e31851 100644 --- a/hwe/a_status.php +++ b/hwe/a_status.php @@ -27,9 +27,8 @@ if($con >= 2) { printLimitMsg($me['turntime']); exit(); } <?=UniqueConst::$serverName?>: 세력도 - - + diff --git a/hwe/a_traffic.php b/hwe/a_traffic.php index 964629e3..fa428370 100644 --- a/hwe/a_traffic.php +++ b/hwe/a_traffic.php @@ -52,8 +52,8 @@ if ($admin['maxonline'] < $curonline) { - - + + diff --git a/hwe/a_vote.php b/hwe/a_vote.php index 1d791b56..2baf2fb4 100644 --- a/hwe/a_vote.php +++ b/hwe/a_vote.php @@ -28,8 +28,8 @@ $vote = $admin['vote']?:['-']; - - + + diff --git a/hwe/b_auction.php b/hwe/b_auction.php index cf7bb8dd..6777f85b 100644 --- a/hwe/b_auction.php +++ b/hwe/b_auction.php @@ -49,8 +49,8 @@ if ($msg2 == "") { - - + + diff --git a/hwe/b_battleCenter.php b/hwe/b_battleCenter.php index 727558de..7463c763 100644 --- a/hwe/b_battleCenter.php +++ b/hwe/b_battleCenter.php @@ -120,8 +120,8 @@ $showGeneral = General::createGeneralObjFromDB($gen); - - + + diff --git a/hwe/b_betting.php b/hwe/b_betting.php index 2ed4ebe3..f0a46032 100644 --- a/hwe/b_betting.php +++ b/hwe/b_betting.php @@ -63,8 +63,8 @@ if($str3){ <?=UniqueConst::$serverName?>: 베팅장 - - + + diff --git a/hwe/b_chiefcenter.php b/hwe/b_chiefcenter.php index 60473f15..960ed5e9 100644 --- a/hwe/b_chiefcenter.php +++ b/hwe/b_chiefcenter.php @@ -15,11 +15,11 @@ $generalObj = General::createGeneralObjFromDB($session->generalID); <?=UniqueConst::$serverName?>: 사령부 - - + + + - diff --git a/hwe/b_currentCity.php b/hwe/b_currentCity.php index 827d7b34..d5d8a98f 100644 --- a/hwe/b_currentCity.php +++ b/hwe/b_currentCity.php @@ -29,10 +29,10 @@ $templates = new \League\Plates\Engine('templates'); - - - + + + diff --git a/hwe/b_dipcenter.php b/hwe/b_dipcenter.php index b937053f..83c49018 100644 --- a/hwe/b_dipcenter.php +++ b/hwe/b_dipcenter.php @@ -58,13 +58,12 @@ var editable = =5||$permission==4)?'true':'false')?>; var nationMsg = notice??'')?>; var scoutmsg = scout_msg??'')?>; - - + + + - - diff --git a/hwe/b_diplomacy.php b/hwe/b_diplomacy.php index da4a7bfa..1b4b94e7 100644 --- a/hwe/b_diplomacy.php +++ b/hwe/b_diplomacy.php @@ -90,9 +90,8 @@ $neutralStateCharMap = [ <?=UniqueConst::$serverName?>: 중원 정보 - - + diff --git a/hwe/b_genList.php b/hwe/b_genList.php index 4deba6fd..98616840 100644 --- a/hwe/b_genList.php +++ b/hwe/b_genList.php @@ -56,8 +56,8 @@ $templates = new \League\Plates\Engine('templates'); - - + + diff --git a/hwe/b_inheritPoint.php b/hwe/b_inheritPoint.php index 3ea50dc8..c9317594 100644 --- a/hwe/b_inheritPoint.php +++ b/hwe/b_inheritPoint.php @@ -51,8 +51,7 @@ foreach(array_keys(General::INHERITANCE_KEY) as $key){ - - + - - + + diff --git a/hwe/b_npc_control.php b/hwe/b_npc_control.php index aa15035d..a48eb63f 100644 --- a/hwe/b_npc_control.php +++ b/hwe/b_npc_control.php @@ -128,13 +128,13 @@ $zeroPolicy = new AutorunNationPolicy($general, ($gameStor->autorun_user)['optio '내정워프': '도시에서 더이상 내정을 수행할 수 없는 경우,
일정확률로 내정이 부족한 다른 도시로 이동합니다.', }; - + + + + + - - - - diff --git a/hwe/b_processing.php b/hwe/b_processing.php index 633421cc..2dfa0a81 100644 --- a/hwe/b_processing.php +++ b/hwe/b_processing.php @@ -75,11 +75,10 @@ $cssList = $commandObj->getCSSFiles(); - - - + + diff --git a/hwe/b_troop.php b/hwe/b_troop.php index bd666d14..e796f8bc 100644 --- a/hwe/b_troop.php +++ b/hwe/b_troop.php @@ -86,8 +86,9 @@ uasort($troops, function($lhs, $rhs){ <?=UniqueConst::$serverName?>: 부대편성 - - + + + diff --git a/hwe/battle_simulator.php b/hwe/battle_simulator.php index 000f0d5c..25d21dc3 100644 --- a/hwe/battle_simulator.php +++ b/hwe/battle_simulator.php @@ -50,11 +50,10 @@ else{ - - - - + + + - - + diff --git a/hwe/select_npc.php b/hwe/select_npc.php index ddb7fb2a..bad23d8f 100644 --- a/hwe/select_npc.php +++ b/hwe/select_npc.php @@ -70,8 +70,7 @@ echo Json::encode($characterAll); - - + diff --git a/hwe/t_board.php b/hwe/t_board.php index 3ff0fe3a..e1389d3c 100644 --- a/hwe/t_board.php +++ b/hwe/t_board.php @@ -54,9 +54,7 @@ $boardName = $isSecretBoard?'기밀실':'회의실'; var isSecretBoard = ; // - - - + diff --git a/hwe/t_diplomacy.php b/hwe/t_diplomacy.php index 109b249f..4223572d 100644 --- a/hwe/t_diplomacy.php +++ b/hwe/t_diplomacy.php @@ -48,11 +48,10 @@ if ($permission < 1) { var permissionLevel = ; // - - + + - diff --git a/hwe/ts/common_deprecated.ts b/hwe/ts/common_deprecated.ts index 6f3b4307..1c8d0f42 100644 --- a/hwe/ts/common_deprecated.ts +++ b/hwe/ts/common_deprecated.ts @@ -1,4 +1,7 @@ import { activeFlip, escapeHtml, isInt, mb_strwidth, mb_strimwidth, convertDictById, convertSet, hexToRgb, isBrightColor, convColorValue, numberWithCommas, linkifyStrWithOpt, TemplateEngine, getIconPath, combineObject, combineArray, activeFlipItem, errUnknown, errUnknownToast, quickReject, nl2br, getNpcColor, initTooltip } from "./common_legacy"; +import jQuery from "jquery"; + + jQuery(function ($) { initTooltip(); @@ -14,6 +17,8 @@ jQuery(function ($) { declare global { interface Window { + $: typeof jQuery; + jQuery: typeof jQuery; /** @deprecated Module 사용할 것 */ escapeHtml: typeof escapeHtml; /** @deprecated Module 사용할 것 */ @@ -63,6 +68,9 @@ declare global { } } +window.$ = jQuery; +window.jQuery = jQuery; + window.escapeHtml = escapeHtml; window.isInt = isInt; window.mb_strwidth = mb_strwidth; diff --git a/hwe/ts/common_legacy.ts b/hwe/ts/common_legacy.ts index 31c520aa..d5c09687 100644 --- a/hwe/ts/common_legacy.ts +++ b/hwe/ts/common_legacy.ts @@ -1,7 +1,7 @@ import { unwrap } from "./util"; -declare const jQuery: JQueryStatic; - +import jQuery from "jquery"; +import 'bootstrap'; /** * <>& 등을 html에서도 그대로 보이도록 escape주는 함수 diff --git a/hwe/ts/troop.ts b/hwe/ts/troop.ts index 1b6b8475..d8d9adf5 100644 --- a/hwe/ts/troop.ts +++ b/hwe/ts/troop.ts @@ -1,5 +1,6 @@ import { errUnknown } from "./common_legacy"; import { launchTroopPlugin } from "./ext.plugin_troop"; +import jQuery from "jquery"; import "../scss/troop.scss"; diff --git a/package.json b/package.json index a10725f5..810e2082 100644 --- a/package.json +++ b/package.json @@ -16,16 +16,17 @@ "author": "Hide_D", "license": "MIT", "dependencies": { - "@babel/runtime": "^7.15.3", "axios": "^0.21.1", + "bootstrap": "^4.6.0", "core-js": "^3.16.1", "lodash": "^4.17.21", - "vue": "^3.2.2" + "luxon": "^2.0.2", + "vue": "^3.2.2", + "jquery": "^3.6.0" }, "devDependencies": { "@babel/cli": "^7.14.8", "@babel/core": "^7.15.0", - "@babel/plugin-transform-runtime": "^7.15.0", "@babel/preset-env": "^7.15.0", "@babel/preset-typescript": "^7.15.0", "@types/bootstrap": "^4.6.1", @@ -36,6 +37,7 @@ "@vue/compiler-sfc": "^3.2.2", "babel-loader": "^8.2.2", "babel-plugin-lodash": "^3.3.4", + "babel-preset-modern-browsers": "^15.0.2", "css-loader": "^6.2.0", "eslint": "^7.32.0", "mini-css-extract-plugin": "^2.2.0", diff --git a/webpack.config.js b/webpack.config.js index b4082d53..dca67621 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -19,6 +19,17 @@ module.exports = [ }, mode: 'production', devtool: 'source-map', + optimization: { + splitChunks: { + cacheGroups: { + commons: { + test: /[\\/]node_modules[\\/]/, + name: 'vendors', + chunks: 'all', + }, + }, + } + }, module: { rules: [{ test: /\.(ts|tsx)$/i, @@ -27,7 +38,12 @@ module.exports = [ loader: 'babel-loader', options: { presets: [ - '@babel/preset-env', + ['@babel/preset-env', { + "targets": "> 0.2%, not ie>8, not op_mini all", + "useBuiltIns": "usage", + "corejs": 3, + "modules": false + }], '@babel/preset-typescript' ] } @@ -74,6 +90,17 @@ module.exports = [ }, mode: 'production', devtool: 'source-map', + optimization: { + splitChunks: { + cacheGroups: { + commons: { + test: /[\\/]node_modules[\\/]/, + name: 'vendors', + chunks: 'all', + }, + }, + } + }, module: { rules: [{ test: /\.(ts|tsx)$/i, @@ -82,7 +109,12 @@ module.exports = [ loader: 'babel-loader', options: { presets: [ - '@babel/preset-env', + ['@babel/preset-env', { + "targets": "> 0.2%, not ie>8, not op_mini all", + "useBuiltIns": "usage", + "corejs": 3, + "modules": false + }], '@babel/preset-typescript' ] }