5
0
mirror of https://github.com/wailsapp/wails.git synced 2025-05-03 01:30:32 +08:00

[v2] Misc template updates

This commit is contained in:
Lea Anthony 2021-09-27 19:09:49 +10:00
parent 8565749b0c
commit 828f07ea13
11 changed files with 28 additions and 36 deletions

View File

@ -0,0 +1 @@
<!-- This file is a placeholder to prevent IDE warnings for go:embed --->

View File

@ -2,11 +2,9 @@ import svelte from 'rollup-plugin-svelte';
import commonjs from '@rollup/plugin-commonjs';
import resolve from '@rollup/plugin-node-resolve';
import livereload from 'rollup-plugin-livereload';
import { terser } from 'rollup-plugin-terser';
import {terser} from 'rollup-plugin-terser';
import copy from 'rollup-plugin-copy';
import image from '@rollup/plugin-image';
import postcss from 'rollup-plugin-postcss'
import url from 'postcss-url';
const production = !process.env.ROLLUP_WATCH;
@ -40,9 +38,6 @@ export default {
file: 'dist/bundle.js'
},
plugins: [
image({
include: './src/assets/images/**'
}),
svelte({
compilerOptions: {
// enable run-time checks when not in production
@ -51,11 +46,6 @@ export default {
}),
postcss({
minimize: true,
plugins: [
url({
url: "inline"
})
]
}),
// If you have external dependencies installed from
// npm, you'll most likely need these plugins. In
@ -69,7 +59,9 @@ export default {
commonjs(),
copy({
targets: [
{ src: 'src/index.html', dest: 'dist/' },
{src: 'src/index.html', dest: 'dist/'},
{src: 'src/global.css', dest: 'dist/'},
{src: 'src/assets', dest: 'dist/'},
]
}),

View File

@ -2,10 +2,10 @@
<html lang="en">
<head>
<meta charset='utf-8'>
<meta name='viewport' content='width=device-width,initial-scale=1'>
<title>Svelte app</title>
<meta content='width=device-width,initial-scale=1' name='viewport'>
<title>{{.ProjectName}}</title>
<link href="/global.css" rel="stylesheet">
<script defer src='bundle.js'></script>
</head>

View File

@ -1,6 +1,4 @@
import App from './App.svelte';
import './global.css';
const app = new App({
target: document.body,

View File

@ -1,9 +1,9 @@
module test
module changeme
go 1.16
require (
github.com/wailsapp/wails/v2 v2.0.0-alpha
github.com/wailsapp/wails/v2 v2.0.0-alpha
)
replace github.com/wailsapp/wails/v2 v2.0.0-alpha => {{.WailsDirectory}}

View File

@ -19,7 +19,7 @@ func main() {
// Create application with options
err := wails.Run(&options.App{
Title: "{{.ProjectName}}",
Title: "",
Width: 720,
Height: 570,
MinWidth: 720,
@ -31,23 +31,23 @@ func main() {
Frameless: false,
StartHidden: false,
HideWindowOnClose: false,
RGBA: &options.RGBA{255, 255, 255, 255},
RGBA: &options.RGBA{R: 255, G: 255, B: 255, A: 255},
Assets: assets,
LogLevel: logger.DEBUG,
OnStartup: app.startup,
OnDomReady: app.domReady,
OnShutdown: app.shutdown,
LogLevel: logger.DEBUG,
OnStartup: app.startup,
OnDomReady: app.domReady,
OnShutdown: app.shutdown,
Bind: []interface{}{
app,
},
// Windows platform specific options
Windows: &windows.Options{
WebviewIsTransparent: false,
WindowIsTranslucent: false,
DisableWindowIcon: false,
WebviewIsTransparent: true,
WindowIsTranslucent: true,
DisableWindowIcon: true,
},
})
if err != nil {
log.Fatal(err)
}

View File

@ -1,9 +1,9 @@
module test
module changeme
go 1.16
require (
github.com/wailsapp/wails/v2 v2.0.0-alpha
github.com/wailsapp/wails/v2 v2.0.0-alpha
)
replace github.com/wailsapp/wails/v2 v2.0.0-alpha => {{.WailsDirectory}}

View File

@ -31,12 +31,12 @@ func main() {
Frameless: false,
StartHidden: false,
HideWindowOnClose: false,
RGBA: &options.RGBA{255, 255, 255, 255},
RGBA: &options.RGBA{R: 255, G: 255, B: 255, A: 255},
Assets: assets,
LogLevel: logger.DEBUG,
OnStartup: app.startup,
OnDomReady: app.domReady,
OnShutdown: app.shutdown,
LogLevel: logger.DEBUG,
OnStartup: app.startup,
OnDomReady: app.domReady,
OnShutdown: app.shutdown,
Bind: []interface{}{
app,
},