Skip to content

Staticbolt Plugin

@staticview/staticbolt-plugin builds staticview web components in a staticbolt site.

Installation

Terminal window
npm install @staticview/staticbolt-plugin

Usage

import { defineConfig } from "@staticbolt/core";
import { staticviewPlugin } from "@staticview/staticbolt-plugin";
export default defineConfig({
plugins: [staticviewPlugin({ include: ["src/components/**/*.ts"] })],
});

Options

Only include is required, and the JSDoc of each option in PluginOptions has the details.

Option Default Use
include Globs of the component files to build.
exclude ["**/*.d.ts"] Globs of the files to skip.
forceProduction The staticbolt mode Picks production or development mode.
sourceMap false Serves source maps on the development server.
loadPostcssConfig false Applies the plugins of your PostCSS config.
postcssPlugins [] Adds PostCSS plugins.
iife false Keeps the component from running on the server.
minify true in production Sets the default of the five options below.
minifyCSS, minifyHTML, minifyJS minify Minify each kind of output.
minifyCssClasses, minifyCssVariables minify Shorten class and custom property names.
minifyCssClassesIgnorePrefix ["_"] Keeps the class names with these prefixes.
minifyCssVariablesIgnorePrefix ["sv-", "_"] Keeps the custom properties with these prefixes.
disabledTrims [] Skips the named output trims.