mirror of
https://github.com/wailsapp/wails.git
synced 2025-05-03 14:29:50 +08:00
[v2] Misc template updates
This commit is contained in:
parent
8565749b0c
commit
828f07ea13
@ -0,0 +1 @@
|
|||||||
|
<!-- This file is a placeholder to prevent IDE warnings for go:embed --->
|
@ -2,11 +2,9 @@ import svelte from 'rollup-plugin-svelte';
|
|||||||
import commonjs from '@rollup/plugin-commonjs';
|
import commonjs from '@rollup/plugin-commonjs';
|
||||||
import resolve from '@rollup/plugin-node-resolve';
|
import resolve from '@rollup/plugin-node-resolve';
|
||||||
import livereload from 'rollup-plugin-livereload';
|
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 copy from 'rollup-plugin-copy';
|
||||||
import image from '@rollup/plugin-image';
|
|
||||||
import postcss from 'rollup-plugin-postcss'
|
import postcss from 'rollup-plugin-postcss'
|
||||||
import url from 'postcss-url';
|
|
||||||
|
|
||||||
const production = !process.env.ROLLUP_WATCH;
|
const production = !process.env.ROLLUP_WATCH;
|
||||||
|
|
||||||
@ -40,9 +38,6 @@ export default {
|
|||||||
file: 'dist/bundle.js'
|
file: 'dist/bundle.js'
|
||||||
},
|
},
|
||||||
plugins: [
|
plugins: [
|
||||||
image({
|
|
||||||
include: './src/assets/images/**'
|
|
||||||
}),
|
|
||||||
svelte({
|
svelte({
|
||||||
compilerOptions: {
|
compilerOptions: {
|
||||||
// enable run-time checks when not in production
|
// enable run-time checks when not in production
|
||||||
@ -51,11 +46,6 @@ export default {
|
|||||||
}),
|
}),
|
||||||
postcss({
|
postcss({
|
||||||
minimize: true,
|
minimize: true,
|
||||||
plugins: [
|
|
||||||
url({
|
|
||||||
url: "inline"
|
|
||||||
})
|
|
||||||
]
|
|
||||||
}),
|
}),
|
||||||
// If you have external dependencies installed from
|
// If you have external dependencies installed from
|
||||||
// npm, you'll most likely need these plugins. In
|
// npm, you'll most likely need these plugins. In
|
||||||
@ -69,7 +59,9 @@ export default {
|
|||||||
commonjs(),
|
commonjs(),
|
||||||
copy({
|
copy({
|
||||||
targets: [
|
targets: [
|
||||||
{ src: 'src/index.html', dest: 'dist/' },
|
{src: 'src/index.html', dest: 'dist/'},
|
||||||
|
{src: 'src/global.css', dest: 'dist/'},
|
||||||
|
{src: 'src/assets', dest: 'dist/'},
|
||||||
]
|
]
|
||||||
}),
|
}),
|
||||||
|
|
||||||
|
@ -2,10 +2,10 @@
|
|||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset='utf-8'>
|
<meta charset='utf-8'>
|
||||||
<meta name='viewport' content='width=device-width,initial-scale=1'>
|
<meta content='width=device-width,initial-scale=1' name='viewport'>
|
||||||
|
|
||||||
<title>Svelte app</title>
|
|
||||||
|
|
||||||
|
<title>{{.ProjectName}}</title>
|
||||||
|
<link href="/global.css" rel="stylesheet">
|
||||||
<script defer src='bundle.js'></script>
|
<script defer src='bundle.js'></script>
|
||||||
</head>
|
</head>
|
||||||
|
|
@ -1,6 +1,4 @@
|
|||||||
|
|
||||||
import App from './App.svelte';
|
import App from './App.svelte';
|
||||||
import './global.css';
|
|
||||||
|
|
||||||
const app = new App({
|
const app = new App({
|
||||||
target: document.body,
|
target: document.body,
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
module test
|
module changeme
|
||||||
|
|
||||||
go 1.16
|
go 1.16
|
||||||
|
|
||||||
require (
|
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}}
|
replace github.com/wailsapp/wails/v2 v2.0.0-alpha => {{.WailsDirectory}}
|
||||||
|
@ -19,7 +19,7 @@ func main() {
|
|||||||
|
|
||||||
// Create application with options
|
// Create application with options
|
||||||
err := wails.Run(&options.App{
|
err := wails.Run(&options.App{
|
||||||
Title: "{{.ProjectName}}",
|
Title: "",
|
||||||
Width: 720,
|
Width: 720,
|
||||||
Height: 570,
|
Height: 570,
|
||||||
MinWidth: 720,
|
MinWidth: 720,
|
||||||
@ -31,23 +31,23 @@ func main() {
|
|||||||
Frameless: false,
|
Frameless: false,
|
||||||
StartHidden: false,
|
StartHidden: false,
|
||||||
HideWindowOnClose: false,
|
HideWindowOnClose: false,
|
||||||
RGBA: &options.RGBA{255, 255, 255, 255},
|
RGBA: &options.RGBA{R: 255, G: 255, B: 255, A: 255},
|
||||||
Assets: assets,
|
Assets: assets,
|
||||||
LogLevel: logger.DEBUG,
|
LogLevel: logger.DEBUG,
|
||||||
OnStartup: app.startup,
|
OnStartup: app.startup,
|
||||||
OnDomReady: app.domReady,
|
OnDomReady: app.domReady,
|
||||||
OnShutdown: app.shutdown,
|
OnShutdown: app.shutdown,
|
||||||
Bind: []interface{}{
|
Bind: []interface{}{
|
||||||
app,
|
app,
|
||||||
},
|
},
|
||||||
// Windows platform specific options
|
// Windows platform specific options
|
||||||
Windows: &windows.Options{
|
Windows: &windows.Options{
|
||||||
WebviewIsTransparent: false,
|
WebviewIsTransparent: true,
|
||||||
WindowIsTranslucent: false,
|
WindowIsTranslucent: true,
|
||||||
DisableWindowIcon: false,
|
DisableWindowIcon: true,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
<html>
|
<html>
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
|
<title>{{.ProjectName}}</title>
|
||||||
<link rel="stylesheet" href="/main.css">
|
<link rel="stylesheet" href="/main.css">
|
||||||
</head>
|
</head>
|
||||||
|
|
@ -1,9 +1,9 @@
|
|||||||
module test
|
module changeme
|
||||||
|
|
||||||
go 1.16
|
go 1.16
|
||||||
|
|
||||||
require (
|
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}}
|
replace github.com/wailsapp/wails/v2 v2.0.0-alpha => {{.WailsDirectory}}
|
||||||
|
@ -31,12 +31,12 @@ func main() {
|
|||||||
Frameless: false,
|
Frameless: false,
|
||||||
StartHidden: false,
|
StartHidden: false,
|
||||||
HideWindowOnClose: false,
|
HideWindowOnClose: false,
|
||||||
RGBA: &options.RGBA{255, 255, 255, 255},
|
RGBA: &options.RGBA{R: 255, G: 255, B: 255, A: 255},
|
||||||
Assets: assets,
|
Assets: assets,
|
||||||
LogLevel: logger.DEBUG,
|
LogLevel: logger.DEBUG,
|
||||||
OnStartup: app.startup,
|
OnStartup: app.startup,
|
||||||
OnDomReady: app.domReady,
|
OnDomReady: app.domReady,
|
||||||
OnShutdown: app.shutdown,
|
OnShutdown: app.shutdown,
|
||||||
Bind: []interface{}{
|
Bind: []interface{}{
|
||||||
app,
|
app,
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user