Skip to content

[build] rollupOptions.input with html and js files has unexpected file output #9933

@lubomirblazekcz

Description

@lubomirblazekcz

Describe the bug

As seen on the link bellow, this is a problem I've noticed now in vituum.

Vituum uses multi-page html in rollupOptions.input and includes js and css files in rollupOptions.input aswell.
That's because we want to have the js and css files not dependable on the linked files in html.

I would expect the result file would have the same name as the input file. But the file is renamed and splitted into two files. Style files works fine, the resulted filename is same as the input file.

I've discovered more unexpected results in https://github.com/newlogic-digital/ui where the js file is splitted and the js file that is used in html contains single js import. Not really great :/

Reproduction

https://stackblitz.com/edit/vitejs-vite-qmi6fm?file=vite.config.js

System Info

System:
    OS: macOS 12.5.1
    CPU: (8) arm64 Apple M1
    Memory: 90.38 MB / 16.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 18.8.0 - ~/.nvm/versions/node/v18.8.0/bin/node
    Yarn: 1.22.15 - ~/.nvm/versions/node/v18.8.0/bin/yarn
    npm: 8.18.0 - ~/.nvm/versions/node/v18.8.0/bin/npm
  Browsers:
    Chrome: 105.0.5195.52
    Chrome Canary: 107.0.5272.0
    Firefox: 104.0
    Firefox Developer Edition: 105.0
    Firefox Nightly: 106.0a1
    Safari: 15.6.1
    Safari Technology Preview: 16.0
  npmPackages:
    vite: ^3.0.9 => 3.0.9

Used Package Manager

npm

Logs

No response

Validations

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions