The following section is an overview of basic configuration for .
Most of the options discussed are specific to , for the rest of the available configuration options please check Vite's config reference.
You can configure Vite.js as usual using vite.config.ts, check Vite's plugins and config reference.
Alternatively, you can provide a vite option in iles.config.ts with the same options.
import { defineConfig } from 'iles'
export default defineConfig({
  vite: {
    plugins: [],
  },
})Visit the Modules and Plugins guide for more details about the pre-configured Vite.js plugins.
You may provide an iles.config.ts configuration file to customize settings
related to markdown, component resolution, and other îles-specific features.
You can leverage your IDE's intellisense by using the defineConfig helper:
import { defineConfig } from 'iles'
export default defineConfig({
  siteUrl: 'https://nuraui.com',
  jsx: 'preact',
})draftsbooleantrue in development, false when buildingWhether to include drafts in pages and documents.
By default drafts will be displayed during development, but will be excluded when building the site.
When disabled, drafts will also be excluded from useDocuments.
modulesIlesModuleOption[]modules to apply in the site. Read the Modules and Plugins guide.
vueobjectvue: {
  template: {
    compilerOptions: {},
  },
}Provides support for Single File Components with Vue 3.
To customize, refer to @vitejs/plugin-vue.
autoImportobjectautoImport: {
  dts: true,
  include: [
    /\.[tj]sx?$/, // .ts, .tsx, .js, .jsx
    /\.vue$/,
    /\.vue\?vue/, // .vue
    /\.md$/, // .md
    /\.mdx$/, // .mdx
    /\.svelte$/, // .svelte
  ],
  imports: [
    'vue',
    // 'vue-i18n',
    // 'vue/macros',
    unheadVueComposablesImports,
    // '@vueuse/core',
    // 'pinia',
    {
      iles: [
        'usePage',
        'useRoute',
        'definePageComponent',
        'useDocuments',
      ],
    }
  ],
  dirs: [
    // 'src/hooks',
    'src/composables', // only root modules
    // 'src/composables/**', // all nested modules
    // 'src/utils',
    // 'src/stores',
  ],
  vueTemplate: true,
  resolvers: [
    /* ... */
  ],
}Enables auto-importing APIs on-demand, and is leveraged internally to support automatic import of APIs and composables from vue, @unhead/vue and from the users's src/composables folder.
To customize, refer to unplugin-auto-import.
componentsobjectcomponents: {
  dts: true,
  extensions: ['vue', 'jsx', 'tsx', 'js', 'ts', 'mdx', 'svelte'],
  include: [/\.vue$/, /\.vue\?vue/, /\.mdx?/],
  dirs: `${srcDir}/components`,
  resolvers: [
    IlesComponentResolver,
    IlesLayoutResolver(appConfig),
  ],
  transformer: 'vue3',
}Enables auto-importing Vue components, and is leveraged internally to support automatic component resolution in MDX files.
To customize, refer to unplugin-vue-components.
turbo (experimental)booleanfalseWhether to enable SPA-like navigation for the site. See the guide for Turbo.
jsx'vue' | 'preact' | 'solid''vue'Which framework to use to compile .jsx and .tsx files.
prettyUrlsbooleantrueWhether to skip .html and trailing slashes in link hrefs and router paths.
Set
prettyUrls: falseto simplify the migration of an existing VitePress site without having to add redirects, or when deploying on services that don't support pretty urls (most do).
ssgOptions applied during site generation when running iles build.
ssg.beforePageRenderasync (page: RouteToRender, config: AppConfig) => RouteToRender | voidThis hook will be invoked before îles renders a page.
Modify
page.renderedto alter the content of the page as needed.
ssg.onSiteRenderedasync ({ pages: RouteToRender[], config: AppConfig }) => voidThis hook will be invoked once îles has rendered the entire site.
ssg.manualChunksAllows to configure how JS chunks for islands should be grouped.
ssg.sitemap booleantrueWhether to generate a sitemap and reference it using a meta tag in all pages.
You must provide siteUrl to enable sitemap generation.
siteUrlstringURL for the site in production, used to generate absolute URLs for the sitemap and social meta tags.
When set, it is exposed as
site.urlandsite.canonical.
debugboolean | 'log'trueWhether to output more information about islands and hydration in development.
iles.config.ts Exampleimport { defineConfig } from 'iles'
import UnoCSS from 'unocss/vite'
export default defineConfig({
  siteUrl: 'https://nuraui.com',
  extendFrontmatter (frontmatter, filename) {
    if (filename.includes('/posts/'))
      frontmatter.layout = 'post'
  },
  markdown: {
    remarkPlugins: [
      'remark-gemoji',
    ],
  },
  modules: [
    '@islands/icons',
    '@islands/headings',
    '@islands/prism',
  ],
  vite: {
    plugins: [
      UnoCSS(),
    ],
  },
})