#Additional html file not being include in build?
18 messages · Page 1 of 1 (latest)
I think that depends on the web framework/bundler you are using
How are you building the project?
If you put page.html in the distDir that you specified when you set up the tauri project, it should work:
"build": {
"beforeBuildCommand": "",
"beforeDevCommand": "",
"devPath": "../dist",
"distDir": "../<path for your production built html files>"
},
I'm just testing with vanilla html/js. I'm building using npm.
Anything I copy in the dist folder gets deleted in the build process.
Hmmm actually how are you using npm for building the project haha
Do you mind sharing the build config inside the tauri.config.json file
If you are using vanilla html/js, I think there shouldn't be any build process involved
Building/bundling the frontend file that is..
I just using the automatically scaffolded project as I really don't know what I'm doing.
"build": {
"beforeDevCommand": "npm run dev",
"beforeBuildCommand": "npm run build",
"devPath": "http://localhost:1420",
"distDir": "../dist",
"withGlobalTauri": true
}
For building you mean you are running npm tauri build right
Maybe change the build config like how tauri doc is suggesting for vanilla html/css project:
{
"build": {
"beforeBuildCommand": "",
"beforeDevCommand": "",
"devPath": "../ui",
"distDir": "../ui",
"withGlobalTauri": true
},
and put your files in a ui folder
I guess there is 2 meaning for building the project:
Bundling frontend files: Involves minifying your javascript,css,html file and resolve import path etc.Building rust project: tauri puts your bundled frontend files into the rust executable file and create the desktop application
Since you are using vanilla html/css, there shouldn't be any frontend bundling involved
oh ok, bit of a learning curve. All the config was generated when I created the project. I will research more on what you've said.
You probably selected the Vanilla > TypeScript option. If you select Vanilla > JavaScript, it will generate almost exactly what @marsh thorn posted above; the only difference being ../src instead of ../ui.