如何在 Svelte 的汇总配置中指定 index.html 的路径

How to specify the path of index.html in Rollup config for Svelte

我使用默认的 Rollup 配置作为我的 Svelte 打包器,但我想为打包文件使用不同的路径 index.html

我可以通过以下方式成功更改捆绑文件的路径:

export default {
  input: "src/main.ts",
  output: {
    sourcemap: true,
    format: "iife",
    name: "app",
    file: "../static/build/bundle.js",
}, 

但它仍然在原路径中寻找index.html文件。我也想将其添加到 static 文件夹中,就像构建文件一样。

如何配置汇总以指定单个 index.html 文件的路径?

sveltejs/template the build config does not deal with the html file, you can simply manually move it to where you want it to be. That said, you could use the copy plugin for rollup 构建期间复制文件。