Skip to content

Commit 5c89bd1

Browse files
committed
리액트 샘플 실습용
1 parent d653c2b commit 5c89bd1

File tree

4 files changed

+3
-33
lines changed

4 files changed

+3
-33
lines changed

react-sample/babel.config.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
module.exports = {
22
presets: [
33
// TODO: 리액트 프리셋을 추가하세요.
4-
"@babel/preset-react"
54
],
65
plugins: [
76
// TODO: 리액트 핫로더 플러그인을 추가하세요.
8-
"react-hot-loader/babel"
97
]
108
};

react-sample/package.json

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,7 @@
1111
"author": "",
1212
"license": "ISC",
1313
"dependencies": {
14-
"react": "^16.12.0",
15-
"react-dom": "^16.12.0"
1614
},
1715
"devDependencies": {
18-
"@babel/core": "^7.7.7",
19-
"@babel/preset-react": "^7.7.4",
20-
"css-loader": "^3.4.2",
21-
"html-webpack-plugin": "^3.2.0",
22-
"react-hot-loader": "^4.12.18",
23-
"style-loader": "^1.1.2",
24-
"webpack": "^4.41.5",
25-
"webpack-dev-server": "^3.10.1"
2616
}
2717
}

react-sample/src/Hello.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import * as React from 'react';
2-
import { hot } from 'react-hot-loader';
32
import Name from './Name';
43

54
class Hello extends React.Component {
@@ -8,4 +7,5 @@ class Hello extends React.Component {
87
}
98
}
109

11-
export default hot(module)(Hello);
10+
// TODO: 핫로더를 지원하는 컴퍼넌트로 변환하세요
11+
export default Hello

react-sample/webpack.config.js

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
const path = require("path");
2-
const HtmlWebpackPlugin = require("html-webpack-plugin");
3-
const { CleanWebpackPlugin } = require("clean-webpack-plugin");
42

53
module.exports = {
64
mode: "development",
@@ -15,26 +13,10 @@ module.exports = {
1513
overlay: true,
1614
stats: "errors-only",
1715
// TODO: react-hot-loader를 사용하도록 구성하세요.
18-
hot: true
1916
},
2017
module: {
2118
rules: [
22-
// TODO: 리액트 프리셋후에 바벨 로더를 설정하세요.
23-
{
24-
test: /\.js$/,
25-
exclude: /node_modules/,
26-
loader: "babel-loader" // 바벨 로더를 추가한다
27-
},
28-
{
29-
test: /\.css$/,
30-
use: ["style-loader", "css-loader"]
31-
}
19+
// TODO: js(리액트 코드 포함)와 css 파일 변환을 위한 로더를 구성하세요
3220
]
3321
},
34-
plugins: [
35-
new CleanWebpackPlugin(),
36-
new HtmlWebpackPlugin({
37-
template: "./src/index.html"
38-
})
39-
]
4022
};

0 commit comments

Comments
 (0)