0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

【astro】ビルド時に生成されるファイル名について

Posted at

astroはビルド時の出力ファイル名をbuild.formatで設定できる。

export default defineConfig({
  devToolbar: { enabled: false },
  compressHTML: false,
  build: {
    format: 'ココ!',
    inlineStylesheets: 'never',
  },

種類

file

  build: {
    format: 'file',
    inlineStylesheets: 'never',
  },

生成されるHTMLファイル

src/pages/index.astro -> dist/index.html
src/pages/foo/index.astro -> dist/foo.html
src/pages/foo/bar.astro -> dist/foo/bar.html

directory

  build: {
    format: 'directory',
    inlineStylesheets: 'never',
  },

生成されるHTMLファイル

src/pages/index.astro -> dist/index.html
src/pages/foo/index.astro -> dist/foo/index.html

preserve

  build: {
    format: 'preserve',
    inlineStylesheets: 'never',
  },

※Astro v4.3以降

生成されるHTMLファイル

src/pages/about.astro -> dist/about.html
src/pages/about/index.astro -> dist/about/index.html
0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?