0.0.20 • Published 1 year ago

@macropygia/vite-plugin-pug-static v0.0.20

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

@macropygia/vite-plugin-pug-static

npm version MIT TypeScript Vite Pug

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

ParameterTypeDefaultRequired
buildOptionsobjectNo
buildLocalsobjectNo
serveOptionsobjectNo
serverLocalsobjectNo
ignorePatternstring \| string[]No
reloadbooleantrueNo

buildOptions

buildLocals

serveOptions

serveLocals

ignorePattern

reload

  • Enable/disable full-reload when any file is modified.
0.0.20

1 year ago

0.0.19

1 year ago

0.0.18

3 years ago

0.0.10

3 years ago

0.0.11

3 years ago

0.0.12

3 years ago

0.0.13

3 years ago

0.0.14

3 years ago

0.0.15

3 years ago

0.0.9

3 years ago

0.0.16

3 years ago

0.0.17

3 years ago

0.0.8

3 years ago

0.0.7

3 years ago

0.0.6

3 years ago

0.0.5

3 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago