wails-pure-js-template/README.md

43 lines
1.8 KiB
Markdown
Raw Permalink Normal View History

2022-08-25 18:38:35 +00:00
## About
2023-10-03 18:13:24 +00:00
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).
2023-10-03 17:58:35 +00:00
2023-10-03 18:13:24 +00:00
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.
2022-08-25 18:38:35 +00:00
2022-08-25 18:56:54 +00:00
## Instruction
1. Do all the setup/ installation for [Wails](https://wails.io/docs/gettingstarted/installation).
2. Open command prompt on your desire directory.
2023-10-03 18:13:24 +00:00
3. ``> wails init -n [your-app-name] -t https://github.com/KiddoV/wails-pure-js-template``
4. ``> cd ./[your-app-name]``
5. ``> wails dev``
2022-08-25 18:56:54 +00:00
6. Keep developing...
2022-08-25 18:38:35 +00:00
## Live Development
2023-10-03 17:58:35 +00:00
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.
2022-08-25 18:38:35 +00:00
## Building
2023-10-03 17:58:35 +00:00
To build a redistribute, production mode package, use `wails build`.
2022-08-25 18:56:54 +00:00
2022-08-25 19:14:13 +00:00
Or build with [UPX](https://upx.github.io/) for better distribution size: ``wails build -upx -upxflags="--best --lzma"``
2022-09-21 11:17:55 +00:00
To use ``UPX``, you need to download and at least put the path in the ``System Enviroment Variables``:
*Windows*
![Capture](https://user-images.githubusercontent.com/28552977/191490618-b84d307e-f783-4c68-bd90-3f484de25478.PNG)
2023-10-03 17:58:35 +00:00
## 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.
2023-10-03 18:13:24 +00:00
2023-10-03 17:58:35 +00:00
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.
2023-10-03 18:13:24 +00:00
2023-10-03 17:58:35 +00:00
E.g.
```html
<script src="../libs/jquery/jquery-3.7.1.js"></script>
```