diff --git a/packages/template/base/tmpl/index.js b/packages/template/base/tmpl/index.js index 8740fc55f5..121c5c9f80 100644 --- a/packages/template/base/tmpl/index.js +++ b/packages/template/base/tmpl/index.js @@ -1,8 +1,9 @@ -const { app, BrowserWindow } = require('electron'); -const path = require('node:path'); +import { app, BrowserWindow } from 'electron'; +import path from 'node:path'; +import started from 'electron-squirrel-startup'; // Handle creating/removing shortcuts on Windows when installing/uninstalling. -if (require('electron-squirrel-startup')) { +if (started) { app.quit(); } diff --git a/packages/template/vite-typescript/tmpl/main.ts b/packages/template/vite-typescript/tmpl/main.ts index cbd9c22b0d..87d1373816 100644 --- a/packages/template/vite-typescript/tmpl/main.ts +++ b/packages/template/vite-typescript/tmpl/main.ts @@ -1,8 +1,9 @@ import { app, BrowserWindow } from 'electron'; import path from 'path'; +import started from 'electron-squirrel-startup'; // Handle creating/removing shortcuts on Windows when installing/uninstalling. -if (require('electron-squirrel-startup')) { +if (started) { app.quit(); } diff --git a/packages/template/vite/src/ViteTemplate.ts b/packages/template/vite/src/ViteTemplate.ts index ef14ad9544..45c64c586c 100644 --- a/packages/template/vite/src/ViteTemplate.ts +++ b/packages/template/vite/src/ViteTemplate.ts @@ -15,7 +15,6 @@ class ViteTemplate extends BaseTemplate { title: 'Setting up Forge configuration', task: async () => { await this.copyTemplateFile(directory, 'forge.config.js'); - await this.copyTemplateFile(directory, 'forge.env.d.ts'); }, }, { diff --git a/packages/template/vite/test/ViteTemplate_spec.ts b/packages/template/vite/test/ViteTemplate_spec.ts index b772b962d4..4c82f58137 100644 --- a/packages/template/vite/test/ViteTemplate_spec.ts +++ b/packages/template/vite/test/ViteTemplate_spec.ts @@ -28,7 +28,6 @@ describe('ViteTemplate', () => { context('template files are copied to project', () => { const expectedFiles = [ 'package.json', - 'forge.env.d.ts', 'forge.config.js', 'vite.main.config.mjs', 'vite.preload.config.mjs', diff --git a/packages/template/vite/tmpl/forge.env.d.ts b/packages/template/vite/tmpl/forge.env.d.ts deleted file mode 100644 index 9700e0ae19..0000000000 --- a/packages/template/vite/tmpl/forge.env.d.ts +++ /dev/null @@ -1 +0,0 @@ -///