I having issues with css file loading I followed the Post this works on dev mode but when I npm run make now css is not loading asper in the comment, How can i fix it ?
My webpack.plugin.js
/* eslint-disable @typescript-eslint/no-var-requires */
const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');
const CopyWebPackPlugin = require('copy-webpack-plugin');
const path = require('path');
module.exports = [
new ForkTsCheckerWebpackPlugin(),
new CopyWebPackPlugin({
patterns: [
{
to: path.resolve(__dirname, '.webpack/renderer', 'assets'),
from: path.resolve(__dirname, 'src', 'assets')
}
]
})
];
Plugins in package.json
{
.....
"plugins": [
[
"@electron-forge/plugin-webpack",
{
"mainConfig": "./webpack.main.config.js",
"renderer": {
"config": "./webpack.renderer.config.js",
"entryPoints": [
{
"html": "./src/html/index.html",
"js": "./src/render/index.tsx",
"name": "main_window",
"preload": {
"js": "./src/electron/preloads/mainPreload.ts"
}
}
]
}
}
]
]
....
}
Html File
<!DOCTYPE html>
<html lang="en">
<head lang="en">
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link href="/assets/styles/main.css" rel="stylesheet" />
</head>
<body>
<div id="root" class="w-100 h-100"></div>
</body>
</html>
My Folder Structure