Skip to content

Output a index.html.template to make it idempotent #6

Description

@MrBlenny

When using this with envsub, once the substitution runs, the env vars are replaced.
The pattern I have been using is envsub dist/index.html.template dist/index.html - i.e. using the index.html as a template.

It would be nice to document this pattern and add an option to output an index.html.template file

  "scripts": {
    "build": "tsc && vite build && cp dist/index.html dist/index.html.template",
    "serve": "envsub dist/index.html.template dist/index.html && vite preview --host",
  },

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions