mirror of
https://github.com/KiddoV/wails-pure-js-template.git
synced 2025-09-26 19:11:12 +08:00
some updates...
This commit is contained in:
24
.gitignore
vendored
Normal file
24
.gitignore
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
# After editing .gitignore to match the ignored files, you can do < git ls-files -ci --exclude-standard >
|
||||
# to see the files that are included in the exclude lists; you can then do
|
||||
#
|
||||
# @ Linux/MacOS: < git ls-files -ci --exclude-standard -z | xargs -0 git rm --cached >
|
||||
# @ Windows (PowerShell): < git ls-files -ci --exclude-standard | % { git rm --cached "$_" } >
|
||||
# @ Windows (cmd.exe): < for /F "tokens=*" %a in ('git ls-files -ci --exclude-standard') do @git rm --cached "%a" >
|
||||
# ...to re-init the ignore list
|
||||
|
||||
# Wails directories
|
||||
build/bin
|
||||
frontend/wailsjs
|
||||
|
||||
# Wails junk files
|
||||
.syso
|
||||
|
||||
# Go files
|
||||
go.sum
|
||||
|
||||
# IDEs
|
||||
.idea
|
||||
.vscode
|
||||
|
||||
# System enviroment variables
|
||||
env
|
30
README.md
30
README.md
@@ -1,28 +1,26 @@
|
||||
# README
|
||||
|
||||
## About
|
||||
|
||||
This is a super simple wails template with basic web components (HTML, CSS, JS) without any front-end frameworks.
|
||||
You gotta to build everything from scratch. Good luck!
|
||||
This is an extremely straightforward Wails template, comprising essential web components (HTML, CSS, JS) and intentionally lacking any front-end frameworks, dependencies, or Node package management. As a result, you'll end up with an exceptionally lightweight source folder (1 - 5MB).
|
||||
That being said, this is a good template for something like a ``Hello World`` application, which doesn't require you to store ~200-300MB of source files.
|
||||
|
||||
You'll need to construct everything from the ground up. Good luck!
|
||||
|
||||
## Instruction
|
||||
|
||||
1. Do all the setup/ installation for [Wails](https://wails.io/docs/gettingstarted/installation).
|
||||
2. Open command prompt on your desire directory.
|
||||
3. ``$ wails init -n [your-app-name] -t https://github.com/KiddoV/wails-pure-js-template``
|
||||
4. ``$ cd ./[your-app-name]``
|
||||
5. ``$ wails dev``
|
||||
3. ``$> wails init -n [your-app-name] -t https://github.com/KiddoV/wails-pure-js-template``
|
||||
4. ``$> cd ./[your-app-name]``
|
||||
5. ``$> wails dev``
|
||||
6. Keep developing...
|
||||
|
||||
## Live Development
|
||||
|
||||
To run in live development mode, run `wails dev` in the project directory. In another terminal, go into the `frontend`
|
||||
directory and run `npm run dev`. The frontend dev server will run on http://localhost:34115. Connect to this in your
|
||||
browser and connect to your application.
|
||||
To run in live development mode, run `wails dev` in the project directory. The frontend dev server will run on http://localhost:34115. Connect to this in your browser and connect to your application.
|
||||
|
||||
## Building
|
||||
|
||||
To build a redistributable, production mode package, use `wails build`.
|
||||
To build a redistribute, production mode package, use `wails build`.
|
||||
|
||||
Or build with [UPX](https://upx.github.io/) for better distribution size: ``wails build -upx -upxflags="--best --lzma"``
|
||||
|
||||
@@ -31,3 +29,13 @@ To use ``UPX``, you need to download and at least put the path in the ``System E
|
||||
*Windows*
|
||||

|
||||
|
||||
## Adding Dependencies
|
||||
|
||||
You don't have to rely on ``npm`` to add dependencies.
|
||||
|
||||
If your application requires internet access, you can add dependencies via a ``CDN`` links.
|
||||
If your application is used offline, simply download dependencies and save them in the ``src/libs`` folder, then import them in the index.html file.
|
||||
E.g.
|
||||
```html
|
||||
<script src="../libs/jquery/jquery-3.7.1.js"></script>
|
||||
```
|
@@ -1,9 +0,0 @@
|
||||
#! /bin/bash
|
||||
|
||||
echo -e "Start running the script..."
|
||||
cd ../
|
||||
|
||||
echo -e "Start building the app for macos platform..."
|
||||
wails build --clean --platform darwin/arm64
|
||||
|
||||
echo -e "End running the script!"
|
@@ -1,9 +0,0 @@
|
||||
#! /bin/bash
|
||||
|
||||
echo -e "Start running the script..."
|
||||
cd ../
|
||||
|
||||
echo -e "Start building the app for macos platform..."
|
||||
wails build --clean --platform darwin
|
||||
|
||||
echo -e "End running the script!"
|
@@ -1,9 +0,0 @@
|
||||
#! /bin/bash
|
||||
|
||||
echo -e "Start running the script..."
|
||||
cd ../
|
||||
|
||||
echo -e "Start building the app for macos platform..."
|
||||
wails build --clean --platform darwin/universal
|
||||
|
||||
echo -e "End running the script!"
|
@@ -1,9 +0,0 @@
|
||||
#! /bin/bash
|
||||
|
||||
echo -e "Start running the script..."
|
||||
cd ../
|
||||
|
||||
echo -e "Start building the app for windows platform..."
|
||||
wails build --clean --platform windows/amd64
|
||||
|
||||
echo -e "End running the script!"
|
@@ -1,9 +0,0 @@
|
||||
#! /bin/bash
|
||||
|
||||
echo -e "Start running the script..."
|
||||
cd ../
|
||||
|
||||
echo -e "Start building the app..."
|
||||
wails build --clean
|
||||
|
||||
echo -e "End running the script!"
|
@@ -1,14 +0,0 @@
|
||||
#! /bin/bash
|
||||
|
||||
echo -e "Start running the script..."
|
||||
cd ../
|
||||
|
||||
echo -e "Current Go version: \c"
|
||||
go version
|
||||
|
||||
echo -e "Install the Wails command line tool..."
|
||||
go install github.com/wailsapp/wails/v2/cmd/wails@latest
|
||||
|
||||
echo -e "Successful installation!"
|
||||
|
||||
echo -e "End running the script!"
|
Reference in New Issue
Block a user