Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

357
Views
Loading static asses like css in to electron with electron-forge?

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

Folder Stricture

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!