Skip to content

Transforming index.html sets Content-Type: application/javascript #504

@jakobrosenberg

Description

@jakobrosenberg

Do NOT ignore this template or your issue will have a very high chance to be closed without comment.

Describe the bug

Transforming index.html sets Content-Type: application/javascript for index.html.

Should be text/html.

Reproduction

Please provide a link to a repo that can reproduce the problem you ran into.

  const server = vite.createServer({
    ...options,
    transforms: [{
      test: ({ id }) => id === '/',
      transform: ({ code }) => code.replace('__SCRIPT__', '<script>...</script>')
    }],
  }).listen(3000)

System Info

  • required vite version: 1.0.0-beta.11
  • required Operating System: Windows
  • required Node version: 12.14.1

Logs (Optional if provided reproduction)

[vite] failed to parse / for import rewrite.
If you are using JSX, make sure to named the file with the .jsx extension.

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