@fictjs/vite-plugin
v0.14.0
Published
Vite plugin for Fict
Maintainers
Readme
@fictjs/vite-plugin
Vite plugin for Fict
Usage
npm install -D @fictjs/vite-plugin
# or
yarn add -D @fictjs/vite-pluginYou can visit Fict for more documentation.
Options
import fict from '@fictjs/vite-plugin'
export default defineConfig({
plugins: [
fict({
// Optional transform cache (memory + persistent disk cache)
cache: { persistent: true },
// Optional TypeScript project integration
useTypeScriptProject: true,
tsconfigPath: './tsconfig.json',
// Optional plugin debug logs (or set FICT_VITE_PLUGIN_DEBUG=1)
debug: false,
// Allow $state/$effect inside reactive-scope callbacks (e.g., renderHook(() => ...))
reactiveScopes: ['renderHook'],
}),
],
})Core defaults:
include:['**/*.tsx', '**/*.jsx']exclude:['**/node_modules/**']useTypeScriptProject:truecache:- enabled by default
- memory cache always on
- persistent cache defaults to
trueduringvite build, otherwise in-memory only
Compiler option passthrough:
- This plugin forwards compiler options directly (for example:
strictGuarantee,strictReactivity,lazyConditional,emitModuleMetadata,warningLevels,reactiveScopes). - Current compiler default is
strictGuarantee: true(fail-closed).
Runtime dev/prod define:
- The plugin defines
__DEV__automatically:truein dev serverfalsein production build
Recommended profiles:
// Strict app/CI baseline
fict({
strictGuarantee: true,
})
// Migration / benchmark compatibility
fict({
strictGuarantee: false,
emitModuleMetadata: false,
dev: false,
})Notes:
reactiveScopesonly applies to direct calls and only treats the first argument as the reactive callback.- Aliased/indirect calls are not recognized (e.g.,
const rh = renderHook; rh(() => ...)). debuglogs are disabled by default; enable withdebug: trueorFICT_VITE_PLUGIN_DEBUG=1.
