Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(vite-template): fix vite template start failed after package #3713

Merged
merged 3 commits into from
Nov 12, 2024
Merged
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
7 changes: 4 additions & 3 deletions packages/template/base/tmpl/index.js
Original file line number Diff line number Diff line change
@@ -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();
}

Expand Down
3 changes: 2 additions & 1 deletion packages/template/vite-typescript/tmpl/main.ts
Original file line number Diff line number Diff line change
@@ -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();
}

Expand Down
1 change: 0 additions & 1 deletion packages/template/vite/src/ViteTemplate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
},
},
{
Expand Down
1 change: 0 additions & 1 deletion packages/template/vite/test/ViteTemplate_spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
1 change: 0 additions & 1 deletion packages/template/vite/tmpl/forge.env.d.ts

This file was deleted.