wails
wails copied to clipboard
Add import aliases to every framework template
Is your feature request related to a problem? Please describe.
Referencing the bindings is cumbersome and a deep structure might involve an import like
import { Greet } from '../../../../../wailsjs/go/main/App'
Describe the solution you'd like
For each template that uses a framework with imports, create import aliases for the core paths / files that frontend will import.
wailsjs/go/main/Appcan be aliased to something like#wails/bindings:
import { Greet } from '#wails/bindings';
wailsjs/go/runtime/runtimecan be aliased to something like#wails/runtime:
import { Quit } from '#wails/runtime';
wailsjs/go/modelscan be aliased to something like#wails/models:
import { main } from '#wails/models';
The import has to be changed in multiple places including package.json, vite.config.js (if applicable), tsconfig.json (if applicable)
Describe alternatives you've considered
No response
Additional context
The VueJS template has an alias @ for the frontend/src folder, so import aliases are already used
Did you know you can set the directory of the generated bindings using the wailsjsdir project config option?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
@SheetJSDev - was there anything more you felt needed to happen with this?