Skip to content

Commit

Permalink
[Task] #58, webpack configuriation to allow regular css files as well…
Browse files Browse the repository at this point in the history
… as modules
  • Loading branch information
Type-Style committed May 6, 2024
1 parent 4916309 commit 57c8e1c
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 50 deletions.
6 changes: 3 additions & 3 deletions src/client/components/App.tsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
import React from 'react';
import { BrowserRouter as Router, Route, Routes, Link } from 'react-router-dom';
import Contacts from './Contacts';
import * as css from "./css/app.module.css";
import "./css/app.css";

import Provider from "./context"

const App = () => {
return (
<Provider>
<div className={css.app}>
<div className="app">
<Router>
<Routes>
<Route path="/contacts" element={<Contacts />} />
<Route path="/" element={
<>
<h1 className={css.headline}>Hello, React! <br />
<h1 className="headline">Hello, React! <br />
<Link to="/contacts">Go to Contacts</Link></h1>
</>
} />
Expand Down
44 changes: 0 additions & 44 deletions src/client/components/css/app.module.css

This file was deleted.

13 changes: 10 additions & 3 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,22 @@ module.exports = (args) => {
{
test: /\.css$/,
use: [
'style-loader',
"style-loader",
{
loader: 'css-loader',
loader: "css-loader",
options: {
importLoaders: 1,
modules: true,
},
},
],
}
include: /\.module\.css$/,
},
{
test: /\.css$/,
use: ["style-loader", "css-loader"],
exclude: /\.module\.css$/,
},
],
},
resolve: {
Expand Down

0 comments on commit 57c8e1c

Please sign in to comment.