0.0.19 • Published 2 months ago
@macropygia/vite-plugin-pug-static v0.0.19
@macropygia/vite-plugin-pug-static
English | 日本語
Vite plugin to serve multiple Pug as HTML with middleware and build to static HTML.
- This package is currently unstable.
- Breaking changes may occur without any notice, even if in patch releases.
- See CHANGELOG for changes.
- This package only works as ESM.
"type": "module"
is required in the package.json of the project using this plugin.
- Suitable for a traditional static site.
- Currently, full-reload is always triggered when any file is modified.
- Compilation is triggered only when necessary.
Usage
// vite.config.js
import { defineConfig } from 'vite'
import vitePluginPugStatic from '@macropygia/vite-plugin-pug-static'
export default defineConfig({
root: 'src',
build: {
rollupOptions: {
input: {
home: 'src/index.pug',
foo: 'src/foo/index.pug',
bar: 'src/bar/index.pug',
}
}
},
plugins: [
vitePluginPugStatic({
buildOptions: { basedir: "./src" },
serveOptions: { basedir: "./src" },
}),
],
})
Options
Parameter | Type | Default | Required |
---|---|---|---|
buildOptions | object | No | |
buildLocals | object | No | |
serveOptions | object | No | |
serverLocals | object | No | |
ignorePattern | string \| string[] | No | |
reload | boolean | true | No |
buildOptions
- Pug options for build.
- Ref. Options - Pug
buildLocals
- The locals object of pug for build.
- Ref. API Reference - Pug
serveOptions
- Pug options for dev server.
- Ref. Options - Pug
serveLocals
- The locals object of pug for dev server.
- Ref. API Reference - Pug
ignorePattern
- Ignore pattern for dev server.
- Use root-relative path. (Starts with
/
) - Ref. Globbing features - Picomatch
- Compatible with vite-plugin-inspect by default.
reload
- Enable/disable full-reload when any file is modified.
0.0.19
2 months ago
0.0.18
1 year ago
0.0.10
2 years ago
0.0.11
2 years ago
0.0.12
2 years ago
0.0.13
2 years ago
0.0.14
2 years ago
0.0.15
2 years ago
0.0.9
2 years ago
0.0.16
2 years ago
0.0.17
2 years ago
0.0.8
2 years ago
0.0.7
2 years ago
0.0.6
2 years ago
0.0.5
2 years ago
0.0.4
2 years ago
0.0.3
2 years ago
0.0.2
2 years ago
0.0.1
2 years ago