Skip to content

Commit

Permalink
merge: [REFACTOR] 트랜스파일러 Babel에서 SWC로 변경 (#420)
Browse files Browse the repository at this point in the history
  • Loading branch information
novice0840 authored Dec 12, 2024
2 parents f6be80c + 0a217a2 commit 6cb911f
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 27 deletions.
9 changes: 3 additions & 6 deletions frontend/.storybook/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const config: StorybookConfig = {
name: '@storybook/react-webpack5',
options: {
builder: {
useSWC: true,
useSWC: true, // Storybook의 SWC 설정 활성화
},
},
},
Expand All @@ -25,16 +25,13 @@ const config: StorybookConfig = {
webpackFinal: async (config: Configuration) => {
const { resolve, module } = config;

// storybook에 emotion 관련 babel 설정 추가
// storybook에 emotion 관련 SWC 설정 추가
module?.rules?.push({
test: /\.(ts|tsx)$/,
exclude: /node_modules/,
use: [
{
loader: require.resolve('babel-loader'),
options: {
plugins: [require.resolve('@emotion/babel-plugin')],
},
loader: require.resolve('swc-loader'),
},
],
});
Expand Down
8 changes: 6 additions & 2 deletions frontend/.swcrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,15 @@
"syntax": "typescript",
"tsx": true
},
"target": "esnext",
"transform": {
"react": {
"runtime": "automatic"
"runtime": "automatic",
"importSource": "@emotion/react"
}
}
},
"env": {
"targets": "> 1%, not dead",
"coreJs": "3.37"
}
}
43 changes: 26 additions & 17 deletions frontend/package-lock.json

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

3 changes: 2 additions & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
"@emotion/react": "^11.11.4",
"@sentry/react": "^8.24.0",
"@tanstack/react-query": "^5.51.1",
"@tanstack/react-query-devtools": "^5.51.23",
"copy-webpack-plugin": "^12.0.2",
"react": "^18.3.1",
"react-dom": "^18.3.1",
Expand Down Expand Up @@ -54,6 +53,7 @@
"@swc/core": "^1.7.24",
"@swc/jest": "^0.2.36",
"@tanstack/eslint-plugin-query": "^5.51.1",
"@tanstack/react-query-devtools": "^5.62.1",
"@testing-library/jest-dom": "^6.4.6",
"@testing-library/react": "^16.0.0",
"@testing-library/user-event": "^14.5.2",
Expand Down Expand Up @@ -90,6 +90,7 @@
"stylelint": "^16.7.0",
"stylelint-config-standard": "^36.0.1",
"stylelint-order": "^6.0.4",
"swc-loader": "^0.2.6",
"ts-loader": "^9.5.1",
"typescript": "^5.5.3",
"undici": "^6.19.2",
Expand Down
2 changes: 1 addition & 1 deletion frontend/webpack.config.prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ module.exports = merge(common, {
{
test: /\.(js|jsx|ts|tsx)$/,
exclude: /node_modules/,
use: ['babel-loader'],
use: ['swc-loader'],
},
],
},
Expand Down

0 comments on commit 6cb911f

Please sign in to comment.