Skip to content

Commit 2d7433c

Browse files
authored
Merge pull request #4 from smotyl/feat/css-loader
Feat: Add css-loader
2 parents f4ca7a2 + 1e0f22f commit 2d7433c

File tree

5 files changed

+899
-780
lines changed

5 files changed

+899
-780
lines changed

configs/webpack.config.js

+4
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ module.exports = (config) => {
4646
module: {
4747
rules: [
4848
typescript ? tsLoader : babelLoader,
49+
{
50+
test: /\.css$/i,
51+
use: ["style-loader", "css-loader"],
52+
},
4953
]
5054
}
5155
}

package.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "basic-react-scripts",
3-
"version": "0.0.8",
3+
"version": "0.0.9",
44
"main": "index.js",
55
"author": "Sandro Motyl",
66
"license": "MIT",
@@ -25,8 +25,10 @@
2525
"babel-loader": "^8.2.2",
2626
"child_process": "^1.0.2",
2727
"choose-port": "^0.3.2",
28+
"css-loader": "^5.2.0",
2829
"html-webpack-plugin": "^5.3.1",
2930
"open": "^8.0.4",
31+
"style-loader": "^2.0.0",
3032
"ts-loader": "^8.1.0",
3133
"typescript": "^4.2.3",
3234
"webpack": "^5.28.0",

src/App.tsx

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
import * as React from 'react'
22

3+
import './styles.css'
4+
35
const App = () => {
4-
return <h1>Hello, Typescript!</h1>;
6+
return <span>Hello, Typescript!</span>;
57
}
68

79
export default App;

src/styles.css

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
* {
2+
background-color: greenyellow;
3+
}

0 commit comments

Comments
 (0)