diff --git a/v2/cmd/wails/internal/commands/initialise/templates/templates/svelte/main.go.tmpl b/v2/cmd/wails/internal/commands/initialise/templates/templates/svelte/main.go.tmpl new file mode 100644 index 00000000..b18d160a --- /dev/null +++ b/v2/cmd/wails/internal/commands/initialise/templates/templates/svelte/main.go.tmpl @@ -0,0 +1,52 @@ +package main + +import ( +"embed" +"log" + +"github.com/wailsapp/wails/v2/pkg/options/windows" + +"github.com/wailsapp/wails/v2" +"github.com/wailsapp/wails/v2/pkg/logger" +"github.com/wailsapp/wails/v2/pkg/options" +) + +//go:embed frontend/dist +var assets embed.FS + +func main() { + + // Create application with options + app := NewApp() + + err := wails.Run(&options.App{ +Title: "", +Width: 800, +Height: 600, +MinWidth: 400, +MinHeight: 400, +MaxWidth: 1280, +MaxHeight: 1024, +DisableResize: false, +Fullscreen: false, +Frameless: false, +StartHidden: false, +HideWindowOnClose: false, +RGBA: 0x000000FF, +Assets: assets, +Windows: &windows.Options{ + WebviewIsTransparent: true, + WindowBackgroundIsTranslucent: true, + DisableWindowIcon: true, + }, + LogLevel: logger.DEBUG, + OnStartup: app.startup, + OnShutdown: app.shutdown, + Bind: []interface{}{ + app, + }, + }) + if err != nil { + log.Fatal(err) + } +} diff --git a/v2/cmd/wails/internal/commands/initialise/templates/templates/svelte/main.tmpl.go b/v2/cmd/wails/internal/commands/initialise/templates/templates/svelte/main.tmpl.go deleted file mode 100644 index c945d6b8..00000000 --- a/v2/cmd/wails/internal/commands/initialise/templates/templates/svelte/main.tmpl.go +++ /dev/null @@ -1,53 +0,0 @@ -package main - -import ( - "log" - - "github.com/wailsapp/wails/v2/pkg/options/windows" - - "github.com/wailsapp/wails/v2" - "github.com/wailsapp/wails/v2/pkg/logger" - "github.com/wailsapp/wails/v2/pkg/options" - "github.com/wailsapp/wails/v2/pkg/options/mac" -) - -func main() { - - // Create application with options - app := NewApp() - - err := wails.Run(&options.App{ - Title: "{{.ProjectName}}", - Width: 800, - Height: 600, - MinWidth: 400, - MinHeight: 400, - MaxWidth: 1280, - MaxHeight: 1024, - DisableResize: false, - Fullscreen: false, - Frameless: false, - StartHidden: false, - HideWindowOnClose: false, - RGBA: 0x000000FF, - Windows: &windows.Options{ - WebviewIsTransparent: true, - WindowBackgroundIsTranslucent: true, - DisableWindowIcon: true, - }, - Mac: &mac.Options{ - WebviewIsTransparent: true, - WindowBackgroundIsTranslucent: true, - TitleBar: mac.TitleBarHiddenInset(), - }, - LogLevel: logger.DEBUG, - OnStartup: app.startup, - OnShutdown: app.shutdown, - Bind: []interface{}{ - app, - }, - }) - if err != nil { - log.Fatal(err) - } -} diff --git a/v2/cmd/wails/internal/commands/initialise/templates/templates/svelte/wails.tmpl.json b/v2/cmd/wails/internal/commands/initialise/templates/templates/svelte/wails.tmpl.json index 4d164476..16e81d97 100644 --- a/v2/cmd/wails/internal/commands/initialise/templates/templates/svelte/wails.tmpl.json +++ b/v2/cmd/wails/internal/commands/initialise/templates/templates/svelte/wails.tmpl.json @@ -1,11 +1,11 @@ { - "name": "{{.ProjectName}}", - "outputfilename": "{{.BinaryName}}", - "html": "frontend/dist/index.html", - "frontend:build": "npm run build", - "frontend:install": "npm install", - "author": { - "name": "{{.AuthorName}}", - "email": "{{.AuthorEmail}}" - } + "name": "{{.ProjectName}}", + "outputfilename": "{{.BinaryName}}", + "assetdir": "frontend/dist", + "frontend:build": "npm run build", + "frontend:install": "npm install", + "author": { + "name": "{{.AuthorName}}", + "email": "{{.AuthorEmail}}" + } } \ No newline at end of file