Skip to content

Commit

Permalink
Refactor/#427 ts-loader를 fork-ts-checker-webpack-plugin으로 대체한다 (#428)
Browse files Browse the repository at this point in the history
* config: fork-ts-checker-webpack-plugin 설치

* config: ts-loader 패키지 및 설정 제거

* config: fork-ts-checker-webpack-plugin 적용

* config: browser 타겟을 `last 2 years`로 설정

- South Korea 기준 72.2% 지원
- 참고: https://browsersl.ist/#q=last+2+years&region=KR

* config: fork-ts-checker-webpack-plugin의 issue 설정 변경

* config: browser 타겟을 `last 2 years, not dead`로 변경

- South Korea 기준 83.9% 지원
- 참고: https://browsersl.ist/#q=last+2+years%2C+not+dead&region=KR
  • Loading branch information
cruelladevil authored Sep 21, 2023
1 parent 4375c18 commit 63c03aa
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 113 deletions.
12 changes: 7 additions & 5 deletions frontend/babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,17 @@ module.exports = {
[
'@babel/preset-env',
{
targets: {
// TODO: 브라우저 지원 범위
chrome: '51',
},
targets: 'last 2 years, not dead',
useBuiltIns: 'entry',
corejs: '3.31.1',
},
],
['@babel/preset-react'],
[
'@babel/preset-react',
{
runtime: 'automatic',
},
],
['@babel/preset-typescript'],
],
};
106 changes: 1 addition & 105 deletions frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
"eslint-plugin-react": "^7.32.2",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-storybook": "^0.6.12",
"fork-ts-checker-webpack-plugin": "^8.0.0",
"html-webpack-plugin": "^5.5.3",
"jest": "^29.6.1",
"jest-environment-jsdom": "^29.6.1",
Expand All @@ -65,7 +66,6 @@
"stylelint": "^15.10.2",
"stylelint-config-clean-order": "^5.0.1",
"ts-jest": "^29.1.1",
"ts-loader": "^9.4.4",
"tsconfig-paths-webpack-plugin": "^4.1.0",
"webpack": "^5.88.1",
"webpack-cli": "^5.1.4",
Expand Down
12 changes: 12 additions & 0 deletions frontend/webpack.common.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');

module.exports = {
entry: './src/index.tsx',
Expand Down Expand Up @@ -41,6 +42,17 @@ module.exports = {
new CopyWebpackPlugin({
patterns: [{ from: './public/assets/og', to: './static/og' }],
}),
new ForkTsCheckerWebpackPlugin({
typescript: {
diagnosticOptions: {
syntactic: true,
},
},
issue: {
include: [{ file: '**/src/**/*.{ts,tsx}' }],
exclude: [{ file: '**/*.test.{ts,tsx}' }],
},
}),
],
resolve: {
extensions: ['.tsx', '.ts', '.jsx', '.js'],
Expand Down
1 change: 0 additions & 1 deletion frontend/webpack.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ module.exports = merge(common, {
plugins: ['react-refresh/babel'],
},
},
'ts-loader',
],
},
],
Expand Down
2 changes: 1 addition & 1 deletion frontend/webpack.prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ module.exports = merge(common, {
{
test: /\.tsx?$/,
exclude: /node_modules/,
use: ['babel-loader', 'ts-loader'],
use: ['babel-loader'],
},
],
},
Expand Down

0 comments on commit 63c03aa

Please sign in to comment.