Skip to content

Commit

Permalink
feat: add css-loader and style-loader for webpack
Browse files Browse the repository at this point in the history
  • Loading branch information
chershentan committed May 17, 2024
1 parent cfaedf5 commit 8c8c425
Show file tree
Hide file tree
Showing 4 changed files with 101 additions and 19 deletions.
112 changes: 94 additions & 18 deletions package-lock.json

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

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
"babel-jest": "^26.6.3",
"babel-loader": "^8.2.2",
"cross-env": "^7.0.3",
"css-loader": "^7.1.1",
"eslint": "^7.32.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-jest": "^24.3.6",
Expand All @@ -87,6 +88,7 @@
"react-dom": "^17.0.2",
"semantic-release": "^17.4.2",
"storybook": "^7.6.15",
"style-loader": "^4.0.0",
"typescript": "^4.2.4",
"webpack": "^5.44.0",
"webpack-cli": "^4.6.0",
Expand Down
2 changes: 1 addition & 1 deletion src/components/renderer/PdfRenderer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Document, Page, pdfjs } from "react-pdf";
import { repeat } from "../../utils";
import { Renderer } from "../../types";
import "react-pdf/dist/Page/TextLayer.css";
import 'react-pdf/dist/Page/AnnotationLayer.css'
import "react-pdf/dist/Page/AnnotationLayer.css"

Check failure on line 6 in src/components/renderer/PdfRenderer.tsx

View workflow job for this annotation

GitHub Actions / Test

Insert `;`

// TODO check this https://github.com/wojtekmaj/react-pdf#browserify-and-others
pdfjs.GlobalWorkerOptions.workerSrc = `//cdnjs.cloudflare.com/ajax/libs/pdf.js/${pdfjs.version}/pdf.worker.js`;
Expand Down
4 changes: 4 additions & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ module.exports = {
loader: "babel-loader",
},
},
{
test: /\.css$/i,
use: ["style-loader", "css-loader"],
},
],
},
};

0 comments on commit 8c8c425

Please sign in to comment.