Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 0 additions & 16 deletions .eslintrc.json

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes
2,306 changes: 0 additions & 2,306 deletions bun.lock

This file was deleted.

83 changes: 23 additions & 60 deletions forge.config.ts
Original file line number Diff line number Diff line change
@@ -1,54 +1,23 @@
import type { ForgeConfig } from "@electron-forge/shared-types";
import path from "path";
import { MakerSquirrel } from "@electron-forge/maker-squirrel";
import { MakerZIP } from "@electron-forge/maker-zip";
import { MakerDeb } from "@electron-forge/maker-deb";
import { MakerRpm } from "@electron-forge/maker-rpm";
import { MakerDMG } from "@electron-forge/maker-dmg";
import { AutoUnpackNativesPlugin } from "@electron-forge/plugin-auto-unpack-natives";
import { WebpackPlugin } from "@electron-forge/plugin-webpack";
import { VitePlugin } from "@electron-forge/plugin-vite";
import { FusesPlugin } from "@electron-forge/plugin-fuses";
import { FuseV1Options, FuseVersion } from "@electron/fuses";
import ForgeExternalsPlugin from "@timfish/forge-externals-plugin";

import { mainConfig } from "./webpack.main.config";
import { rendererConfig } from "./webpack.renderer.config";

const config: ForgeConfig = {
packagerConfig: {
asar: {
unpack: "**/node_modules/{sharp,@img}/**/*",
},
// Use icons from assets/icons/pulp.(ico|icns|png) depending on platform
icon: path.resolve(__dirname, "assets/icons/pulp"),
ignore: () => false,
icon: "./assets/icons/logo",
},
rebuildConfig: {},
makers: [
new MakerSquirrel({
setupIcon: path.resolve(__dirname, "assets/icons/pulp.ico"),
}),
new MakerDMG({
// DMG configuration
format: "ULFO",
icon: path.resolve(__dirname, "assets/icons/pulp.icns"),
contents: (opts) => [
{
x: 130,
y: 220,
type: "file",
path: opts.appPath,
},
{
x: 410,
y: 220,
type: "link",
path: "/Applications",
},
],
icon: "./assets/icons/logo.icns",
}),
new MakerZIP({}, ["darwin"]),
new MakerRpm({}),
new MakerDeb({}),
],
publishers: [
{
Expand All @@ -64,33 +33,27 @@ const config: ForgeConfig = {
},
],
plugins: [
new AutoUnpackNativesPlugin({}),
new WebpackPlugin({
mainConfig,
devContentSecurityPolicy:
"default-src 'self'; script-src 'self' 'unsafe-eval'; style-src 'self' 'unsafe-inline'; img-src 'self' data: blob:; connect-src 'self' ws:;",
renderer: {
config: rendererConfig,
entryPoints: [
{
html: "./src/index.html",
js: "./src/renderer.tsx",
name: "main_window",
preload: {
js: "./src/preload.ts",
},
},
],
},
}),
// ForgeExternalsPlugin handles external dependencies
new ForgeExternalsPlugin({
externals: ["sharp"],
includeDeps: true,
new VitePlugin({
build: [
{
entry: "src/main.ts",
config: "vite.main.config.ts",
target: "main",
},
{
entry: "src/preload.ts",
config: "vite.preload.config.ts",
target: "preload",
},
],
renderer: [
{
name: "main_window",
config: "vite.renderer.config.ts",
},
],
}),

// Fuses are used to enable/disable various Electron functionality
// at package time, before code signing the application
new FusesPlugin({
version: FuseVersion.V1,
[FuseV1Options.RunAsNode]: false,
Expand Down
1 change: 1 addition & 0 deletions forge.env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/// <reference types="@electron-forge/plugin-vite/forge-vite-env" />
3 changes: 2 additions & 1 deletion src/index.html → index.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<!DOCTYPE html>
<!doctype html>
<html>
<head>
<meta charset="UTF-8" />
<title>Pulp | Image compressor</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/renderer.tsx"></script>
</body>
</html>
Loading