Stand with Ukraine 🇺🇦
Eleventy
The possum is Eleventy’s mascot

Eleventy Documentation

Menu

Vite IndieWeb Avatar for https://vitejs.dev/ Jump to heading

A plugin to use Vite with Eleventy 2.0+.

Installation Jump to heading

npm install @11ty/eleventy-plugin-vite
const EleventyVitePlugin = require("@11ty/eleventy-plugin-vite");

module.exports = function(eleventyConfig) {
eleventyConfig.addPlugin(EleventyVitePlugin);
};
Expand for full list of options

View the full list of Vite Configuration options.

const EleventyVitePlugin = require("@11ty/eleventy-plugin-vite");

module.exports = function(eleventyConfig) {
eleventyConfig.addPlugin(EleventyVitePlugin, {
tempFolderName: ".11ty-vite", // Default name of the temp folder

// Options passed to the Eleventy Dev Server
// e.g. domdiff, enabled, etc.
// Added in Vite plugin v2.0.0-canary.2
serverOptions: {},

// Defaults are shown:
viteOptions: {
clearScreen: false,
server: {
mode: "development",
middlewareMode: true,
},
build: {
mode: "production",
}
}
});
};

See the full list of serverOptions on the Dev Server documentation.


Other pages in Watch and Serve: