Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

indexHtmlTemplate not working on vite #17257

Closed
diadal opened this issue Jun 5, 2024 · 2 comments
Closed

indexHtmlTemplate not working on vite #17257

diadal opened this issue Jun 5, 2024 · 2 comments

Comments

@diadal
Copy link
Contributor

diadal commented Jun 5, 2024

What happened?

App • ⚠️ The file /index.html is missing. Please add it back.

how to rename index.html in vite

 sourceFiles: {
      indexHtmlTemplate: ctx.mode?.capacitor
        ? 'index.cap.html'
        : 'index.web.html',
    }

What did you expect to happen?

renamed index.html should work

Reproduction URL

no link

How to reproduce?

https://v2.quasar.dev/quasar-cli-vite/quasar-config-js#sourcefiles

Flavour

Quasar CLI with Vite (@quasar/cli | @quasar/app-vite)

Areas

Quasar CLI Commands/Configuration (@quasar/cli | @quasar/app-webpack | @quasar/app-vite), TypeScript Support, SPA Mode, Capacitor Mode

Platforms/Browsers

No response

Quasar info output

Operating System - Darwin(23.5.0) - darwin/arm64
NodeJs - 20.12.2

Global packages
  NPM - 10.8.1
  yarn - 1.22.22
  pnpm - Not installed
  bun - Not installed
  @quasar/cli - 2.4.1
  @quasar/icongenie - 3.1.1
  cordova - Not installed

Important local packages
  quasar - 2.16.4 -- Build high-performance VueJS user interfaces (SPA, PWA, SSR, Mobile and Desktop) in record time
  @quasar/app-vite - 2.0.0-beta.14 -- Quasar Framework App CLI with Vite
  @quasar/extras - 1.16.11 -- Quasar Framework fonts, icons and animations
  eslint-plugin-quasar - Not installed
  vue - 3.4.26 -- The progressive JavaScript framework for building modern web UI.
  vue-router - 4.3.2
  pinia - 2.1.7 -- Intuitive, type safe and flexible Store for Vue
  vuex - Not installed
  vite - 5.2.11 -- Native-ESM powered web dev build tool
  vite-plugin-checker - Not installed
  eslint - 8.57.0 -- An AST-based pattern checker for JavaScript.
  esbuild - 0.20.2 -- An extremely fast JavaScript and CSS bundler and minifier.
  typescript - 5.4.5 -- TypeScript is a language for application scale JavaScript development
  workbox-build - 7.1.0 -- A module that integrates into your build process, helping you generate a manifest of local files that workbox-sw should precache.
  register-service-worker - Not installed
  electron - Not installed
  electron-packager - Not installed
  @electron/packager - Not installed
  electron-builder - Not installed
  @capacitor/core - 6.0.0 -- Capacitor: Cross-platform apps with JavaScript and the web
  @capacitor/cli - 6.0.0 -- Capacitor: Cross-platform apps with JavaScript and the web
  @capacitor/android - 6.0.0 -- Capacitor: Cross-platform apps with JavaScript and the web
  @capacitor/ios - 6.0.0 -- Capacitor: Cross-platform apps with JavaScript and the web

Quasar App Extensions
  *None installed*


### Relevant log output

_No response_

### Additional context

_No response_
Copy link

github-actions bot commented Jun 5, 2024

Hi @diadal! 👋

It looks like you provided an invalid or unsupported reproduction URL.
Do not use any service other than Codepen, jsFiddle, StackBlitz, Codesandbox, and GitHub.
Make sure the URL you provided is correct and reachable. You can test it by visiting it in a private tab, another device, etc.
Please edit your original post above and provide a valid reproduction URL as explained.

Without a proper reproduction, your issue will have to get closed.

Thank you for your collaboration. 👏

@yusufkandemir
Copy link
Member

Hello. This is not a bug as there is no such option in app-vite. The reason behind that is Vite is designed to work with index.html: https://vitejs.dev/guide/#index-html-and-project-root

You can use EJS in the index.html file. So, you can do something like:

<% if (ctx.mode.capacitor) { %>
<div>Capacitor specific content</div>
<% } %>

@yusufkandemir yusufkandemir closed this as not planned Won't fix, can't repro, duplicate, stale Jun 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants