Skip to content

Commit 8af7859

Browse files
authored
feat: webpack build, buld-dev 속도 개선 (#1002)
* chore: 센트리 비활성화 * chore: ts-loader가 타입 검사를 중복으로 수행하지 않도록 함 * chore: 사용되지 않는 코드 주석처리 * chore: emotion을 위해 jsx pragma를 쓰지 않아도 되도록 쑤정 * chore: dev 환경에선 불필요한 터서 최적화 제거 * chore: deprecated된 [has]를 [contenthash]로 변경 * chore: prod 환경에 터서 최적화 장착 * chore: 원본 코드 없이 라인 트래킹만 가능한 소스맵으로 변경 * chore: prod환경에서는 파일시스템 캐싱 사용 * chore: 린트를 위해 devdep 업데이트 * chore: 불필요한 공백 제거 * chore: line 커멘드에 --fix 옵션 추가 * chore: node_modules와 webpack cache를 워크플로우에 추가 * fix: hotfix 시에는 타입 체크 필요하므로 prod build에 타입 검사 추가 * fix: 현재 위치에서 요청하지 않도록 publicPath 작성 * fix: 노드 모듈스 캐싱을 뒤쪽에 해서 의미가 없던걸 앞으로 땡김 * chore: CI 과정에도 노드모듈스와 웹팩 캐시 * chore: prod, dev에서 중복으로 사용되는 플러그인을 common에 추가 * chore: import 수정
1 parent 4a8d23b commit 8af7859

File tree

9 files changed

+583
-103
lines changed

9 files changed

+583
-103
lines changed

.github/workflows/frontend-dev-deploy.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,24 @@ jobs:
2626
with:
2727
node-version: "20.15.1"
2828

29+
# 노드모듈스 캐싱
30+
- name: Cache node_modules
31+
uses: actions/cache@v4
32+
with:
33+
path: node_modules
34+
key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }}
35+
restore-keys: |
36+
${{ runner.os }}-node-
37+
38+
# 웹팩 캐싱(패키지락과 프로드웹팩컨픽이 바뀌지 않으면 캐시 사용)
39+
- name: Cache Webpack
40+
uses: actions/cache@v4
41+
with:
42+
path: node_modules/.cache
43+
key: ${{ runner.os }}-webpack-${{ hashFiles('package-lock.json', 'webpack.prod.mjs') }}
44+
restore-keys: |
45+
${{ runner.os }}-webpack-
46+
2947
# 3. 의존성 설치
3048
- name: Install Dependencies
3149
run: npm install

.github/workflows/frontend-prod-deploy.yml

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,28 @@ jobs:
2626
with:
2727
node-version: "20.15.1"
2828

29+
# 노드모듈스 캐싱
30+
- name: Cache node_modules
31+
uses: actions/cache@v4
32+
with:
33+
path: node_modules
34+
key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }}
35+
restore-keys: |
36+
${{ runner.os }}-node-
37+
38+
# 웹팩 캐싱(패키지락과 프로드웹팩컨픽이 바뀌지 않으면 캐시 사용)
39+
- name: Cache Webpack
40+
uses: actions/cache@v4
41+
with:
42+
path: node_modules/.cache
43+
key: ${{ runner.os }}-webpack-${{ hashFiles('package-lock.json', 'webpack.prod.mjs') }}
44+
restore-keys: |
45+
${{ runner.os }}-webpack-
46+
47+
# 5. Prod 환경으로 빌드
48+
- name: Build for Prod environment
49+
run: npm run build
50+
2951
# 3. 의존성 설치
3052
- name: Install Dependencies
3153
run: npm install
@@ -40,10 +62,6 @@ jobs:
4062
echo "KAKAO_REDIRECT_URI=${{ secrets.KAKAO_REDIRECT_URI }}" >> .env.prod
4163
echo "SENTRY_AUTH_TOKEN=${{ secrets.SENTRY_AUTH_TOKEN }}" >> .env.prod
4264
43-
# 5. Prod 환경으로 빌드
44-
- name: Build for Prod environment
45-
run: npm run build
46-
4765
# 6. AWS 인증 설정
4866
- name: Configure AWS credentials
4967
uses: aws-actions/configure-aws-credentials@v3

0 commit comments

Comments
 (0)