#Additional html file not being include in build?

18 messages · Page 1 of 1 (latest)

warped summit
#

Hi guys,

In addition to index.html, I have another file page.html. When building, I see index.html is transformed and copied to the dist folder but not page.html. How do I get this second page to be included in the release?

marsh thorn
#

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>"
},
warped summit
warped summit
marsh thorn
#

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..

warped summit
#

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
}

marsh thorn
#

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:

  1. Bundling frontend files: Involves minifying your javascript,css,html file and resolve import path etc.
  2. 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

warped summit
#

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.

red nebula
#

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.