

230518 서영석 typeScript 추가
@2b607df1d42733c89a2c0185f312366ef68519bd
--- client/views/index.html
+++ client/views/index.html
... | ... | @@ -14,7 +14,6 @@ |
14 | 14 |
|
15 | 15 |
<body> |
16 | 16 |
<div id="root"></div> |
17 |
- <script id="app-start-vue-page">const APP_USER_HTTP_REQUEST_URL = '/';</script> |
|
18 | 17 |
<script src="/client/build/bundle.js"></script> |
19 | 18 |
</body> |
20 | 19 |
</html> |
--- client/views/index.js
... | ... | @@ -1,29 +0,0 @@ |
1 | -/** | |
2 | - * @author : 서영석 | |
3 | - * @since : 2023.02.28 | |
4 | - * @dscription : Vue를 활용한 Client단 구현의 시작점(Index) Component 입니다. | |
5 | - */ | |
6 | - import { createApp } from 'vue'; | |
7 | - | |
8 | - //Router | |
9 | - import AppRouter from './pages/AppRouter.js'; | |
10 | - import AppStore from './pages/AppStore.js'; | |
11 | - import AppFilters from './pages/AppFilters.js'; | |
12 | - | |
13 | - //Application Root Vue Component | |
14 | - import App from './pages/App.vue'; | |
15 | - | |
16 | - const app = createApp(App); | |
17 | - app.use(AppStore) | |
18 | - app.use(AppRouter) | |
19 | - | |
20 | - app.config.globalProperties.$filters = AppFilters | |
21 | - app.mount('#root'); | |
22 | - | |
23 | - //index.html에 정의된 window.AppUserHttpRequestURL을 활용하여, 사용자가 요청한 초기 페이지로 이동 | |
24 | - if (!APP_USER_HTTP_REQUEST_URL && APP_USER_HTTP_REQUEST_URL != '/') { | |
25 | - console.log('index.js APP_USER_HTTP_REQUEST_URL : ', APP_USER_HTTP_REQUEST_URL); | |
26 | - AppRouter.push({ path: APP_USER_HTTP_REQUEST_URL, query: {}}) | |
27 | - } | |
28 | - | |
29 | - (파일 끝에 줄바꿈 문자 없음) |
+++ client/views/index.ts
... | ... | @@ -0,0 +1,20 @@ |
1 | +/** | |
2 | + * @author : 최정우 | |
3 | + * @since : 2022.10.19 | |
4 | + * @dscription : Vue를 활용한 Client단 구현의 시작점(Index) Component 입니다. | |
5 | + */ | |
6 | +import { createApp } from 'vue'; | |
7 | + | |
8 | +import AppRouter from './pages/AppRouter'; | |
9 | +import AppStore from './pages/AppStore'; | |
10 | +import AppFilters from './pages/AppFilters'; | |
11 | + | |
12 | +import App from './pages/App.vue'; | |
13 | + | |
14 | +// const vue = createApp(App).use(AppRouter).mount('#root'); | |
15 | +const vue = createApp(App) | |
16 | +vue.use(AppStore); | |
17 | +vue.use(AppRouter); | |
18 | +vue.config.globalProperties.$filters = AppFilters | |
19 | + | |
20 | +vue.mount('#root'); |
--- client/views/pages/AppFilters.js
+++ client/views/pages/AppFilters.ts
... | ... | @@ -9,13 +9,13 @@ |
9 | 9 |
var _filters = { |
10 | 10 |
|
11 | 11 |
/*전화번호*/ |
12 |
- phone: function (phone) { |
|
12 |
+ phone: function (phone : any) { |
|
13 | 13 |
return phone.replace(/[^0-9]/g, '') |
14 | 14 |
.replace(/(\d{3})(\d{4})(\d{4})/, '($1) $2-$3'); |
15 | 15 |
}, |
16 | 16 |
|
17 | 17 |
/* 반올림 */ |
18 |
- math: function (param) { |
|
18 |
+ math: function (param : any) { |
|
19 | 19 |
if(param == 0){ |
20 | 20 |
return "-"; |
21 | 21 |
} |
... | ... | @@ -23,7 +23,7 @@ |
23 | 23 |
}, |
24 | 24 |
|
25 | 25 |
/* 특수문자 변형 */ |
26 |
- specialCharacter: function (arr) { |
|
26 |
+ specialCharacter: function (arr : any) { |
|
27 | 27 |
arr = arr.replace(/</g, '<'); |
28 | 28 |
arr = arr.replace(/>/g, '>'); |
29 | 29 |
arr = arr.replace(/"/g, '"'); |
... | ... | @@ -34,7 +34,7 @@ |
34 | 34 |
}, |
35 | 35 |
|
36 | 36 |
/* input text 제한 */ |
37 |
- comma: function (text) { |
|
37 |
+ comma: function (text : any) { |
|
38 | 38 |
try { |
39 | 39 |
return text.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ","); |
40 | 40 |
} catch (e) { |
... | ... | @@ -47,7 +47,7 @@ |
47 | 47 |
}, |
48 | 48 |
|
49 | 49 |
/* html text 제한 */ |
50 |
- textLimit: function (text, limit) { |
|
50 |
+ textLimit: function (text : any, limit : any) { |
|
51 | 51 |
if (text === undefined || text === null || text === "" || text.length === 0) { |
52 | 52 |
return text; |
53 | 53 |
} else { |
... | ... | @@ -56,7 +56,7 @@ |
56 | 56 |
}, |
57 | 57 |
|
58 | 58 |
/* 파일 사이즈 */ |
59 |
- fileSize: function (size) { |
|
59 |
+ fileSize: function (size : any) { |
|
60 | 60 |
var result = size + " bytes"; |
61 | 61 |
// optional code for multiples approximation |
62 | 62 |
var type = ["KB", "MB", "GB"]; |
... | ... | @@ -67,7 +67,7 @@ |
67 | 67 |
}, |
68 | 68 |
|
69 | 69 |
/* 숫자 한글 표현 */ |
70 |
- numberSize: function (number) { |
|
70 |
+ numberSize: function (number : any) { |
|
71 | 71 |
var result = number; |
72 | 72 |
// optional code for multiples approximation |
73 | 73 |
var type = ["만", "억", "조", "경", "해"]; |
... | ... | @@ -82,7 +82,7 @@ |
82 | 82 |
//return result; |
83 | 83 |
}, |
84 | 84 |
|
85 |
- isEmpty: function (data) { |
|
85 |
+ isEmpty: function (data : any) { |
|
86 | 86 |
if (data === undefined || data === null || data === "" || data.length === 0 || (data.constructor == Object && Object.keys(data).length === 0)) { |
87 | 87 |
if ((typeof data) === "number") { |
88 | 88 |
return false |
... | ... | @@ -95,7 +95,7 @@ |
95 | 95 |
}, |
96 | 96 |
|
97 | 97 |
/* 빈 데이터 표현 => '-' */ |
98 |
- emptyText: function (text) { |
|
98 |
+ emptyText: function (text : any) { |
|
99 | 99 |
if (text === undefined || text === null || text === "" || text.length === 0) { |
100 | 100 |
return '-'; |
101 | 101 |
} else { |
... | ... | @@ -105,16 +105,19 @@ |
105 | 105 |
|
106 | 106 |
//클라이언트의 현재 일짜와 비교해서 더 작은 지에 대한 여부 확인 |
107 | 107 |
//param - dateText : yyyy-mm-dd (String) |
108 |
- isSmallerClientDate: function (dateText) { |
|
108 |
+ isSmallerClientDate: function (dateText : any) { |
|
109 | 109 |
const date = new Date(dateText); |
110 | 110 |
let clientDate = new Date(); |
111 | 111 |
|
112 | 112 |
let yyyy = clientDate.getFullYear(); |
113 |
- let mm = clientDate.getMonth() + 1; |
|
113 |
+ let mm : any = clientDate.getMonth() + 1; |
|
114 | 114 |
if (mm < 10) { |
115 |
- mm = "0" + mm; |
|
115 |
+ let MM : String; |
|
116 |
+ MM = "0" + mm; |
|
117 |
+ mm=String(mm); |
|
116 | 118 |
} |
117 |
- let dd = clientDate.getDate(); |
|
119 |
+ |
|
120 |
+ let dd : any = clientDate.getDate(); |
|
118 | 121 |
if (dd < 10) { |
119 | 122 |
dd = "0" + dd; |
120 | 123 |
} |
... | ... | @@ -131,7 +134,7 @@ |
131 | 134 |
DEFAULT_REPAIR_SIZE: -5, |
132 | 135 |
|
133 | 136 |
/* 인하 횟수 => 인하 수치 */ |
134 |
- repairMillimeter: function(repairCount) { |
|
137 |
+ repairMillimeter: function(repairCount : any) { |
|
135 | 138 |
const newRepairCount = !repairCount ? 0 : Number(repairCount); |
136 | 139 |
const repairSize = this.DEFAULT_REPAIR_SIZE * newRepairCount; |
137 | 140 |
return repairSize; |
--- client/views/pages/AppRouter.js
+++ client/views/pages/AppRouter.ts
... | ... | @@ -1,13 +1,10 @@ |
1 | 1 |
import { createWebHistory, createRouter } from "vue-router"; |
2 | 2 |
|
3 | 3 |
import Main from '../pages/main/Main.vue'; |
4 |
-import Main2 from '../pages/main/Main2.vue'; |
|
5 | 4 |
|
6 | 5 |
const routes = [ |
7 | 6 |
/* 메인화면 */ |
8 |
- { path: "/", name: "Main", component: Main }, |
|
9 |
- { path: "/Main2", name: "Main2", component: Main2}, |
|
10 |
- |
|
7 |
+ { path: '/', name: '/', component: Main}, |
|
11 | 8 |
]; |
12 | 9 |
|
13 | 10 |
const AppRouter = createRouter({ |
--- client/views/pages/AppStore.js
+++ client/views/pages/AppStore.ts
... | ... | @@ -8,16 +8,10 @@ |
8 | 8 |
getLoginUser: function () { |
9 | 9 |
|
10 | 10 |
}, |
11 |
- getKey: function () { |
|
12 |
- |
|
13 |
- } |
|
14 | 11 |
}, |
15 | 12 |
mutations: { |
16 | 13 |
setLoginUser: function (state, newValue) { |
17 | 14 |
state.loginUser = newValue; |
18 | 15 |
}, |
19 |
- setKey: function (state, newValue) { |
|
20 |
- state.key = newValue; |
|
21 |
- } |
|
22 | 16 |
} |
23 | 17 |
});(파일 끝에 줄바꿈 문자 없음) |
+++ client/views/vue-shim.d.ts
... | ... | @@ -0,0 +1,5 @@ |
1 | +declare module '*.vue' { | |
2 | + import type { DefineComponent } from 'vue' | |
3 | + const component: DefineComponent<{}, {}, any> | |
4 | + export default component | |
5 | +}(파일 끝에 줄바꿈 문자 없음) |
--- package-lock.json
+++ package-lock.json
... | ... | @@ -1,5 +1,5 @@ |
1 | 1 |
{ |
2 |
- "name": "node_vue_web_server_framework_v1.0-master", |
|
2 |
+ "name": "crosswalk", |
|
3 | 3 |
"lockfileVersion": 2, |
4 | 4 |
"requires": true, |
5 | 5 |
"packages": { |
... | ... | @@ -25,6 +25,10 @@ |
25 | 25 |
"vuex": "^4.1.0", |
26 | 26 |
"webpack": "5.74.0", |
27 | 27 |
"webpack-cli": "4.10.0" |
28 |
+ }, |
|
29 |
+ "devDependencies": { |
|
30 |
+ "ts-loader": "^9.4.2", |
|
31 |
+ "typescript": "^5.0.4" |
|
28 | 32 |
} |
29 | 33 |
}, |
30 | 34 |
"node_modules/@ampproject/remapping": { |
... | ... | @@ -952,7 +956,7 @@ |
952 | 956 |
"version": "3.0.2", |
953 | 957 |
"resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", |
954 | 958 |
"integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", |
955 |
- "optional": true, |
|
959 |
+ "devOptional": true, |
|
956 | 960 |
"dependencies": { |
957 | 961 |
"fill-range": "^7.0.1" |
958 | 962 |
}, |
... | ... | @@ -1561,7 +1565,7 @@ |
1561 | 1565 |
"version": "7.0.1", |
1562 | 1566 |
"resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", |
1563 | 1567 |
"integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", |
1564 |
- "optional": true, |
|
1568 |
+ "devOptional": true, |
|
1565 | 1569 |
"dependencies": { |
1566 | 1570 |
"to-regex-range": "^5.0.1" |
1567 | 1571 |
}, |
... | ... | @@ -1960,7 +1964,7 @@ |
1960 | 1964 |
"version": "7.0.0", |
1961 | 1965 |
"resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", |
1962 | 1966 |
"integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", |
1963 |
- "optional": true, |
|
1967 |
+ "devOptional": true, |
|
1964 | 1968 |
"engines": { |
1965 | 1969 |
"node": ">=0.12.0" |
1966 | 1970 |
} |
... | ... | @@ -2142,6 +2146,19 @@ |
2142 | 2146 |
"integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==", |
2143 | 2147 |
"engines": { |
2144 | 2148 |
"node": ">= 0.6" |
2149 |
+ } |
|
2150 |
+ }, |
|
2151 |
+ "node_modules/micromatch": { |
|
2152 |
+ "version": "4.0.5", |
|
2153 |
+ "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", |
|
2154 |
+ "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", |
|
2155 |
+ "dev": true, |
|
2156 |
+ "dependencies": { |
|
2157 |
+ "braces": "^3.0.2", |
|
2158 |
+ "picomatch": "^2.3.1" |
|
2159 |
+ }, |
|
2160 |
+ "engines": { |
|
2161 |
+ "node": ">=8.6" |
|
2145 | 2162 |
} |
2146 | 2163 |
}, |
2147 | 2164 |
"node_modules/mime": { |
... | ... | @@ -2431,7 +2448,7 @@ |
2431 | 2448 |
"version": "2.3.1", |
2432 | 2449 |
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", |
2433 | 2450 |
"integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", |
2434 |
- "optional": true, |
|
2451 |
+ "devOptional": true, |
|
2435 | 2452 |
"engines": { |
2436 | 2453 |
"node": ">=8.6" |
2437 | 2454 |
}, |
... | ... | @@ -3024,7 +3041,7 @@ |
3024 | 3041 |
"version": "5.0.1", |
3025 | 3042 |
"resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", |
3026 | 3043 |
"integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", |
3027 |
- "optional": true, |
|
3044 |
+ "devOptional": true, |
|
3028 | 3045 |
"dependencies": { |
3029 | 3046 |
"is-number": "^7.0.0" |
3030 | 3047 |
}, |
... | ... | @@ -3040,6 +3057,101 @@ |
3040 | 3057 |
"node": ">=0.6" |
3041 | 3058 |
} |
3042 | 3059 |
}, |
3060 |
+ "node_modules/ts-loader": { |
|
3061 |
+ "version": "9.4.2", |
|
3062 |
+ "resolved": "https://registry.npmjs.org/ts-loader/-/ts-loader-9.4.2.tgz", |
|
3063 |
+ "integrity": "sha512-OmlC4WVmFv5I0PpaxYb+qGeGOdm5giHU7HwDDUjw59emP2UYMHy9fFSDcYgSNoH8sXcj4hGCSEhlDZ9ULeDraA==", |
|
3064 |
+ "dev": true, |
|
3065 |
+ "dependencies": { |
|
3066 |
+ "chalk": "^4.1.0", |
|
3067 |
+ "enhanced-resolve": "^5.0.0", |
|
3068 |
+ "micromatch": "^4.0.0", |
|
3069 |
+ "semver": "^7.3.4" |
|
3070 |
+ }, |
|
3071 |
+ "engines": { |
|
3072 |
+ "node": ">=12.0.0" |
|
3073 |
+ }, |
|
3074 |
+ "peerDependencies": { |
|
3075 |
+ "typescript": "*", |
|
3076 |
+ "webpack": "^5.0.0" |
|
3077 |
+ } |
|
3078 |
+ }, |
|
3079 |
+ "node_modules/ts-loader/node_modules/ansi-styles": { |
|
3080 |
+ "version": "4.3.0", |
|
3081 |
+ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", |
|
3082 |
+ "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", |
|
3083 |
+ "dev": true, |
|
3084 |
+ "dependencies": { |
|
3085 |
+ "color-convert": "^2.0.1" |
|
3086 |
+ }, |
|
3087 |
+ "engines": { |
|
3088 |
+ "node": ">=8" |
|
3089 |
+ }, |
|
3090 |
+ "funding": { |
|
3091 |
+ "url": "https://github.com/chalk/ansi-styles?sponsor=1" |
|
3092 |
+ } |
|
3093 |
+ }, |
|
3094 |
+ "node_modules/ts-loader/node_modules/chalk": { |
|
3095 |
+ "version": "4.1.2", |
|
3096 |
+ "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", |
|
3097 |
+ "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", |
|
3098 |
+ "dev": true, |
|
3099 |
+ "dependencies": { |
|
3100 |
+ "ansi-styles": "^4.1.0", |
|
3101 |
+ "supports-color": "^7.1.0" |
|
3102 |
+ }, |
|
3103 |
+ "engines": { |
|
3104 |
+ "node": ">=10" |
|
3105 |
+ }, |
|
3106 |
+ "funding": { |
|
3107 |
+ "url": "https://github.com/chalk/chalk?sponsor=1" |
|
3108 |
+ } |
|
3109 |
+ }, |
|
3110 |
+ "node_modules/ts-loader/node_modules/color-convert": { |
|
3111 |
+ "version": "2.0.1", |
|
3112 |
+ "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", |
|
3113 |
+ "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", |
|
3114 |
+ "dev": true, |
|
3115 |
+ "dependencies": { |
|
3116 |
+ "color-name": "~1.1.4" |
|
3117 |
+ }, |
|
3118 |
+ "engines": { |
|
3119 |
+ "node": ">=7.0.0" |
|
3120 |
+ } |
|
3121 |
+ }, |
|
3122 |
+ "node_modules/ts-loader/node_modules/color-name": { |
|
3123 |
+ "version": "1.1.4", |
|
3124 |
+ "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", |
|
3125 |
+ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", |
|
3126 |
+ "dev": true |
|
3127 |
+ }, |
|
3128 |
+ "node_modules/ts-loader/node_modules/semver": { |
|
3129 |
+ "version": "7.5.1", |
|
3130 |
+ "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.1.tgz", |
|
3131 |
+ "integrity": "sha512-Wvss5ivl8TMRZXXESstBA4uR5iXgEN/VC5/sOcuXdVLzcdkz4HWetIoRfG5gb5X+ij/G9rw9YoGn3QoQ8OCSpw==", |
|
3132 |
+ "dev": true, |
|
3133 |
+ "dependencies": { |
|
3134 |
+ "lru-cache": "^6.0.0" |
|
3135 |
+ }, |
|
3136 |
+ "bin": { |
|
3137 |
+ "semver": "bin/semver.js" |
|
3138 |
+ }, |
|
3139 |
+ "engines": { |
|
3140 |
+ "node": ">=10" |
|
3141 |
+ } |
|
3142 |
+ }, |
|
3143 |
+ "node_modules/ts-loader/node_modules/supports-color": { |
|
3144 |
+ "version": "7.2.0", |
|
3145 |
+ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", |
|
3146 |
+ "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", |
|
3147 |
+ "dev": true, |
|
3148 |
+ "dependencies": { |
|
3149 |
+ "has-flag": "^4.0.0" |
|
3150 |
+ }, |
|
3151 |
+ "engines": { |
|
3152 |
+ "node": ">=8" |
|
3153 |
+ } |
|
3154 |
+ }, |
|
3043 | 3155 |
"node_modules/type-is": { |
3044 | 3156 |
"version": "1.6.18", |
3045 | 3157 |
"resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", |
... | ... | @@ -3050,6 +3162,19 @@ |
3050 | 3162 |
}, |
3051 | 3163 |
"engines": { |
3052 | 3164 |
"node": ">= 0.6" |
3165 |
+ } |
|
3166 |
+ }, |
|
3167 |
+ "node_modules/typescript": { |
|
3168 |
+ "version": "5.0.4", |
|
3169 |
+ "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.0.4.tgz", |
|
3170 |
+ "integrity": "sha512-cW9T5W9xY37cc+jfEnaUvX91foxtHkza3Nw3wkoF4sSlKn0MONdkdEndig/qPBWXNkmplh3NzayQzCiHM4/hqw==", |
|
3171 |
+ "dev": true, |
|
3172 |
+ "bin": { |
|
3173 |
+ "tsc": "bin/tsc", |
|
3174 |
+ "tsserver": "bin/tsserver" |
|
3175 |
+ }, |
|
3176 |
+ "engines": { |
|
3177 |
+ "node": ">=12.20" |
|
3053 | 3178 |
} |
3054 | 3179 |
}, |
3055 | 3180 |
"node_modules/unpipe": { |
... | ... | @@ -4218,7 +4343,7 @@ |
4218 | 4343 |
"version": "3.0.2", |
4219 | 4344 |
"resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", |
4220 | 4345 |
"integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", |
4221 |
- "optional": true, |
|
4346 |
+ "devOptional": true, |
|
4222 | 4347 |
"requires": { |
4223 | 4348 |
"fill-range": "^7.0.1" |
4224 | 4349 |
} |
... | ... | @@ -4660,7 +4785,7 @@ |
4660 | 4785 |
"version": "7.0.1", |
4661 | 4786 |
"resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", |
4662 | 4787 |
"integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", |
4663 |
- "optional": true, |
|
4788 |
+ "devOptional": true, |
|
4664 | 4789 |
"requires": { |
4665 | 4790 |
"to-regex-range": "^5.0.1" |
4666 | 4791 |
} |
... | ... | @@ -4944,7 +5069,7 @@ |
4944 | 5069 |
"version": "7.0.0", |
4945 | 5070 |
"resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", |
4946 | 5071 |
"integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", |
4947 |
- "optional": true |
|
5072 |
+ "devOptional": true |
|
4948 | 5073 |
}, |
4949 | 5074 |
"is-plain-object": { |
4950 | 5075 |
"version": "2.0.4", |
... | ... | @@ -5078,6 +5203,16 @@ |
5078 | 5203 |
"version": "1.1.2", |
5079 | 5204 |
"resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", |
5080 | 5205 |
"integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==" |
5206 |
+ }, |
|
5207 |
+ "micromatch": { |
|
5208 |
+ "version": "4.0.5", |
|
5209 |
+ "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", |
|
5210 |
+ "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", |
|
5211 |
+ "dev": true, |
|
5212 |
+ "requires": { |
|
5213 |
+ "braces": "^3.0.2", |
|
5214 |
+ "picomatch": "^2.3.1" |
|
5215 |
+ } |
|
5081 | 5216 |
}, |
5082 | 5217 |
"mime": { |
5083 | 5218 |
"version": "1.6.0", |
... | ... | @@ -5287,7 +5422,7 @@ |
5287 | 5422 |
"version": "2.3.1", |
5288 | 5423 |
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", |
5289 | 5424 |
"integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", |
5290 |
- "optional": true |
|
5425 |
+ "devOptional": true |
|
5291 | 5426 |
}, |
5292 | 5427 |
"pify": { |
5293 | 5428 |
"version": "4.0.1", |
... | ... | @@ -5683,7 +5818,7 @@ |
5683 | 5818 |
"version": "5.0.1", |
5684 | 5819 |
"resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", |
5685 | 5820 |
"integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", |
5686 |
- "optional": true, |
|
5821 |
+ "devOptional": true, |
|
5687 | 5822 |
"requires": { |
5688 | 5823 |
"is-number": "^7.0.0" |
5689 | 5824 |
} |
... | ... | @@ -5693,6 +5828,72 @@ |
5693 | 5828 |
"resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", |
5694 | 5829 |
"integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==" |
5695 | 5830 |
}, |
5831 |
+ "ts-loader": { |
|
5832 |
+ "version": "9.4.2", |
|
5833 |
+ "resolved": "https://registry.npmjs.org/ts-loader/-/ts-loader-9.4.2.tgz", |
|
5834 |
+ "integrity": "sha512-OmlC4WVmFv5I0PpaxYb+qGeGOdm5giHU7HwDDUjw59emP2UYMHy9fFSDcYgSNoH8sXcj4hGCSEhlDZ9ULeDraA==", |
|
5835 |
+ "dev": true, |
|
5836 |
+ "requires": { |
|
5837 |
+ "chalk": "^4.1.0", |
|
5838 |
+ "enhanced-resolve": "^5.0.0", |
|
5839 |
+ "micromatch": "^4.0.0", |
|
5840 |
+ "semver": "^7.3.4" |
|
5841 |
+ }, |
|
5842 |
+ "dependencies": { |
|
5843 |
+ "ansi-styles": { |
|
5844 |
+ "version": "4.3.0", |
|
5845 |
+ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", |
|
5846 |
+ "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", |
|
5847 |
+ "dev": true, |
|
5848 |
+ "requires": { |
|
5849 |
+ "color-convert": "^2.0.1" |
|
5850 |
+ } |
|
5851 |
+ }, |
|
5852 |
+ "chalk": { |
|
5853 |
+ "version": "4.1.2", |
|
5854 |
+ "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", |
|
5855 |
+ "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", |
|
5856 |
+ "dev": true, |
|
5857 |
+ "requires": { |
|
5858 |
+ "ansi-styles": "^4.1.0", |
|
5859 |
+ "supports-color": "^7.1.0" |
|
5860 |
+ } |
|
5861 |
+ }, |
|
5862 |
+ "color-convert": { |
|
5863 |
+ "version": "2.0.1", |
|
5864 |
+ "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", |
|
5865 |
+ "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", |
|
5866 |
+ "dev": true, |
|
5867 |
+ "requires": { |
|
5868 |
+ "color-name": "~1.1.4" |
|
5869 |
+ } |
|
5870 |
+ }, |
|
5871 |
+ "color-name": { |
|
5872 |
+ "version": "1.1.4", |
|
5873 |
+ "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", |
|
5874 |
+ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", |
|
5875 |
+ "dev": true |
|
5876 |
+ }, |
|
5877 |
+ "semver": { |
|
5878 |
+ "version": "7.5.1", |
|
5879 |
+ "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.1.tgz", |
|
5880 |
+ "integrity": "sha512-Wvss5ivl8TMRZXXESstBA4uR5iXgEN/VC5/sOcuXdVLzcdkz4HWetIoRfG5gb5X+ij/G9rw9YoGn3QoQ8OCSpw==", |
|
5881 |
+ "dev": true, |
|
5882 |
+ "requires": { |
|
5883 |
+ "lru-cache": "^6.0.0" |
|
5884 |
+ } |
|
5885 |
+ }, |
|
5886 |
+ "supports-color": { |
|
5887 |
+ "version": "7.2.0", |
|
5888 |
+ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", |
|
5889 |
+ "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", |
|
5890 |
+ "dev": true, |
|
5891 |
+ "requires": { |
|
5892 |
+ "has-flag": "^4.0.0" |
|
5893 |
+ } |
|
5894 |
+ } |
|
5895 |
+ } |
|
5896 |
+ }, |
|
5696 | 5897 |
"type-is": { |
5697 | 5898 |
"version": "1.6.18", |
5698 | 5899 |
"resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", |
... | ... | @@ -5702,6 +5903,12 @@ |
5702 | 5903 |
"mime-types": "~2.1.24" |
5703 | 5904 |
} |
5704 | 5905 |
}, |
5906 |
+ "typescript": { |
|
5907 |
+ "version": "5.0.4", |
|
5908 |
+ "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.0.4.tgz", |
|
5909 |
+ "integrity": "sha512-cW9T5W9xY37cc+jfEnaUvX91foxtHkza3Nw3wkoF4sSlKn0MONdkdEndig/qPBWXNkmplh3NzayQzCiHM4/hqw==", |
|
5910 |
+ "dev": true |
|
5911 |
+ }, |
|
5705 | 5912 |
"unpipe": { |
5706 | 5913 |
"version": "1.0.0", |
5707 | 5914 |
"resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", |
--- package.json
+++ package.json
... | ... | @@ -1,6 +1,6 @@ |
1 | 1 |
{ |
2 | 2 |
"dependencies": { |
3 |
- "@babe~l/cli": "7.19.3", |
|
3 |
+ "@babel/cli": "7.19.3", |
|
4 | 4 |
"@babel/core": "7.19.3", |
5 | 5 |
"axios": "^1.3.4", |
6 | 6 |
"babel-loader": "8.2.5", |
... | ... | @@ -30,5 +30,9 @@ |
30 | 30 |
"linux-dev": "export NODE_ENV=development&&node ./server/modules/web/server.js", |
31 | 31 |
"webpack-build": "webpack", |
32 | 32 |
"webpack-build-watch": "webpack --watch" |
33 |
+ }, |
|
34 |
+ "devDependencies": { |
|
35 |
+ "ts-loader": "^9.4.2", |
|
36 |
+ "typescript": "^5.0.4" |
|
33 | 37 |
} |
34 | 38 |
} |
+++ tsconfig.json
... | ... | @@ -0,0 +1,21 @@ |
1 | +{ | |
2 | + "compilerOptions": { | |
3 | + /* "composite": true, | |
4 | + "target": "esnext", | |
5 | + "module": "esnext", | |
6 | + "strict": true, | |
7 | + "jsx": "preserve", | |
8 | + "moduleResolution": "node", | |
9 | + "allowImportingTsExtensions": true, | |
10 | + "emitDeclarationOnly": true */ | |
11 | + /* "outDir": "./client/build/", */ | |
12 | + "outDir": "./built/", | |
13 | + "strict": true, | |
14 | + "noImplicitAny": true, | |
15 | + "module": "es6", | |
16 | + "target": "es5", | |
17 | + "jsx": "preserve", | |
18 | + "allowJs": true, | |
19 | + "moduleResolution": "node", | |
20 | + } | |
21 | +}(파일 끝에 줄바꿈 문자 없음) |
--- webpack.config.js
+++ webpack.config.js
... | ... | @@ -30,11 +30,22 @@ |
30 | 30 |
fallback:require.resolve('file-loader') |
31 | 31 |
} |
32 | 32 |
}] |
33 |
+ },{ |
|
34 |
+ test: /\.(ts|tsx)$/, |
|
35 |
+ exclude: /node_modules/, |
|
36 |
+ loader: 'ts-loader', |
|
37 |
+ options: { appendTsSuffixTo: [/\.vue$/] } |
|
33 | 38 |
}], |
34 | 39 |
}, |
35 | 40 |
|
36 | 41 |
plugins: [new VueLoaderPlugin()], |
37 | 42 |
|
43 |
+ resolve: { |
|
44 |
+ //확장자를 순서대로 해석, 여러 파일에서 이름이 동일하지만 다른 확장자를 가진 경우, webpack은 배열의 앞에서부터 파일을 해석하고 남은 것은 해석하지 않음 |
|
45 |
+ //import 시, 확장자 생략 가능 |
|
46 |
+ extensions: [ '.tsx', '.ts', '.jsx', '.js', '.vue', 'json' ], |
|
47 |
+ }, |
|
48 |
+ |
|
38 | 49 |
output: { |
39 | 50 |
path: `${BASE_DIR}/client/build`, // __dirname: webpack.config.js 파일이 위치한 경로 |
40 | 51 |
filename: 'bundle.js' |
Add a comment
Delete comment
Once you delete this comment, you won't be able to recover it. Are you sure you want to delete this comment?