[느린게 싫다면-02] esbuild 로 typescript 서버 실행
2021. 10. 10. 00:45ㆍ개발/TypeScript
Typescript로 프로젝트를 만들면 tsc 속도가 마음에 들지 않고, esbuild 가 속도가 워낙 좋다보니
etcs 라는 패키지를 발견해서 적용해봤다.
프로젝트 주요 적용 사항
- eslint
- prettier
- babel
- nodemon
- path alias
속도는 우선 너무 만족 스러웠다.
1. 기본 javascript 모듈만 사용후 싱글 파일로만 실행
import http from 'http';
const PORT = process.env.PORT || 3000;
const server = http.createServer((req, res) => {
res.writeHead(200, { 'Content-Type': 'text/plain' });
res.end('Hello World');
});
server.listen(PORT, () => {
console.log(`Server running at http://localhost:${PORT}`);
});
M1 기준
2. express + path alias
GitHub link : https://github.com/shingidad/starterkit-typescript-esbuild
'개발 > TypeScript' 카테고리의 다른 글
[Type 없으면 싫다 - 01] Type으로 CamelCase 에서 SnakeCase 로 변경하기 (0) | 2021.09.28 |
---|