Skip to content

Commit

Permalink
feat(template): enable asar by default (#3077)
Browse files Browse the repository at this point in the history
  • Loading branch information
erickzhao committed Jun 15, 2023
1 parent 7a9edbc commit 6bec6ba
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 4 deletions.
9 changes: 8 additions & 1 deletion packages/api/core/src/api/init-scripts/init-npm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,14 @@ export function siblingDep(name: string): string {
}

export const deps = ['electron-squirrel-startup'];
export const devDeps = [siblingDep('cli'), siblingDep('maker-squirrel'), siblingDep('maker-zip'), siblingDep('maker-deb'), siblingDep('maker-rpm')];
export const devDeps = [
siblingDep('cli'),
siblingDep('maker-squirrel'),
siblingDep('maker-zip'),
siblingDep('maker-deb'),
siblingDep('maker-rpm'),
siblingDep('plugin-auto-unpack-natives'),
];
export const exactDevDeps = ['electron'];

export const initNPM = async <T>(dir: string, task: ForgeListrTask<T>): Promise<void> => {
Expand Down
9 changes: 8 additions & 1 deletion packages/template/base/tmpl/forge.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
module.exports = {
packagerConfig: {},
packagerConfig: {
asar: true,
},
rebuildConfig: {},
makers: [
{
Expand All @@ -19,4 +21,9 @@ module.exports = {
config: {},
},
],
plugins: [
{
name: '@electron-forge/plugin-auto-unpack-natives',
},
],
};
6 changes: 5 additions & 1 deletion packages/template/webpack-typescript/tmpl/forge.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,20 @@ 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 { AutoUnpackNativesPlugin } from '@electron-forge/plugin-auto-unpack-natives';
import { WebpackPlugin } from '@electron-forge/plugin-webpack';

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

const config: ForgeConfig = {
packagerConfig: {},
packagerConfig: {
asar: true,
},
rebuildConfig: {},
makers: [new MakerSquirrel({}), new MakerZIP({}, ['darwin']), new MakerRpm({}), new MakerDeb({})],
plugins: [
new AutoUnpackNativesPlugin({}),
new WebpackPlugin({
mainConfig,
renderer: {
Expand Down
7 changes: 6 additions & 1 deletion packages/template/webpack/tmpl/forge.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
module.exports = {
packagerConfig: {},
packagerConfig: {
asar: true,
},
rebuildConfig: {},
makers: [
{
Expand All @@ -20,6 +22,9 @@ module.exports = {
},
],
plugins: [
{
name: '@electron-forge/plugin-auto-unpack-natives',
},
{
name: '@electron-forge/plugin-webpack',
config: {
Expand Down

0 comments on commit 6bec6ba

Please sign in to comment.