svelte_preprocess_fuz_code.ts

view source

Declarations
#

2 declarations

PreprocessFuzCodeOptions
#

svelte_preprocess_fuz_code.ts view source

PreprocessFuzCodeOptions import type {PreprocessFuzCodeOptions} from '@fuzdev/fuz_code/svelte_preprocess_fuz_code.js';

exclude?

File patterns to exclude.

type Array<string | RegExp>

syntax_styler?

Custom SyntaxStyler instance.

type SyntaxStyler

default syntax_styler_global

cache?

Enable in-memory caching.

type boolean

default true

component_imports?

Import sources that resolve to the Code component. Used to verify that <Code> in templates actually refers to Code.svelte.

type Array<string>

default ['@fuzdev/fuz_code/Code.svelte']

on_error?

How to handle errors.

type 'log' | 'throw'

default 'throw' in CI, 'log' otherwise

svelte_preprocess_fuz_code
#

svelte_preprocess_fuz_code.ts view source

(options?: PreprocessFuzCodeOptions): PreprocessorGroup import {svelte_preprocess_fuz_code} from '@fuzdev/fuz_code/svelte_preprocess_fuz_code.js';

Svelte preprocessor that compiles static Code component content at build time, replacing runtime syntax highlighting with pre-rendered HTML.

options

default {}

returns

PreprocessorGroup

a Svelte preprocessor group

examples

// svelte.config.js import {svelte_preprocess_fuz_code} from '@fuzdev/fuz_code/svelte_preprocess_fuz_code.ts'; export default { preprocess: [svelte_preprocess_fuz_code(), vitePreprocess()], };

Depends on
#