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

Production build using the lit-template does not include index.html #5620

Closed
7 tasks done
marcushellberg opened this issue Nov 11, 2021 · 2 comments
Closed
7 tasks done

Comments

@marcushellberg
Copy link

Describe the bug

Application created with npm init vite@latest my-lit-app -- --template lit

When developing with npm run dev, the application works well.

When creating a production build with npm run prod, the build completes successfully. However, the dist folder only contains .js files, not the index.html entrypoint.

Reproduction

The issue can be reproduced on https://vite.new/lit by running npm run build

System Info

System:
    OS: macOS 12.0
    CPU: (10) arm64 Apple M1 Pro
    Memory: 712.44 MB / 32.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 16.13.0 - ~/.nvm/versions/node/v16.13.0/bin/node
    npm: 8.1.0 - ~/.nvm/versions/node/v16.13.0/bin/npm
  Browsers:
    Chrome: 95.0.4638.69
    Safari: 15.0
  npmPackages:
    vite: ^2.6.4 => 2.6.14

Used Package Manager

npm

Logs

No response

Validations

@ygj6
Copy link
Member

ygj6 commented Nov 11, 2021

I believe this is the expected behavior in lib mode, in docs:

With Vite, you can use your index.html for that purpose to get the smooth development experience.

index.html is used for dev testing, if you want to include index.html, maybe you should use index.html as the entry point or not use lib mode. Please clarify your intentions.

@marcushellberg
Copy link
Author

You are right. I got confused because I compared it with the Vue template which did include the index file. I assumed all the templates were equivalent. Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants