Skip to content

Commit 3772aaf

Browse files
fix: sharp 2
1 parent 13e4cbe commit 3772aaf

5 files changed

Lines changed: 9 additions & 79 deletions

File tree

forge.config.js

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ module.exports = {
1313
'./extra-resources'
1414
],
1515
asar: {
16-
unpack: "{**/.webpack/main/*.worker.js,**/node_modules/{sharp,@img}/**/*}",
16+
unpack: '**/.webpack/main/*.worker.js',
1717
},
1818
...process.env.OSX_SIGN && {
1919
osxSign: {
@@ -49,11 +49,8 @@ module.exports = {
4949
],
5050
plugins: [
5151
{
52-
name: '@timfish/forge-externals-plugin',
53-
config: {
54-
externals: ['sharp'],
55-
includeDeps: true,
56-
},
52+
name: '@electron-forge/plugin-auto-unpack-natives',
53+
config: {},
5754
},
5855
{
5956
name: '@electron-forge/plugin-webpack',
@@ -101,8 +98,8 @@ module.exports = {
10198
[FuseV1Options.EnableCookieEncryption]: true,
10299
[FuseV1Options.EnableNodeOptionsEnvironmentVariable]: false,
103100
[FuseV1Options.EnableNodeCliInspectArguments]: false,
104-
[FuseV1Options.EnableEmbeddedAsarIntegrityValidation]: false,
105-
[FuseV1Options.OnlyLoadAppFromAsar]: false,
101+
[FuseV1Options.EnableEmbeddedAsarIntegrityValidation]: true,
102+
[FuseV1Options.OnlyLoadAppFromAsar]: true,
106103
}),
107104
],
108105
};

package-lock.json

Lines changed: 0 additions & 60 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
"@electron-forge/plugin-fuses": "^7.10.2",
2929
"@electron-forge/plugin-webpack": "^7.10.2",
3030
"@electron/fuses": "^1.8.0",
31-
"@timfish/forge-externals-plugin": "^0.2.1",
3231
"@vercel/webpack-asset-relocator-loader": "^1.7.3",
3332
"babel-loader": "^10.0.0",
3433
"css-loader": "^6.11.0",

src/lib/workers/export.worker.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ import {
1717
EXTMeshGPUInstancing,
1818
} from '@gltf-transform/extensions';
1919
import { ktx2 } from 'ktx2-encoder/gltf-transform';
20-
// import sharp from 'sharp';
2120
import { PNG } from 'pngjs';
2221
import jpeg from 'jpeg-js';
2322

webpack.main.config.js

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// const ThreadsPlugin = require('threads-plugin');
2+
const webpack = require('webpack');
23

34
module.exports = {
45
entry: {
@@ -8,20 +9,14 @@ module.exports = {
89
'mesh.worker': './src/lib/workers/mesh.worker.js',
910
'export.worker': './src/lib/workers/export.worker.js',
1011
},
11-
externals: {
12-
sharp: 'commonjs sharp'
13-
},
12+
plugins: [
13+
new webpack.IgnorePlugin({ resourceRegExp: /^sharp$/ })
14+
],
1415
target: 'electron-main',
1516
output: {
1617
filename: '[name].js',
1718
},
18-
// Put your normal webpack config below here
1919
module: {
2020
rules: require('./webpack.rules'),
2121
},
22-
// plugins: [
23-
// new ThreadsPlugin({
24-
// target: 'electron-node', // important for Electron main process
25-
// }),
26-
// ],
2722
};

0 commit comments

Comments
 (0)