[]previous and next page

importProtection

The import protection plugin.

The import protection plugin.

Import#

ts
import { importProtection } from "@shadow-js/dusk/vite";

Signature#

ts
function importProtection(getRoot: () => string, options: ImportProtectionOptions): Plugin

Parameters#

Name Description
getRoot Returns the absolute project root (paths in messages are relative to it).
options Extra globs and exemptions.

Returns#

A Vite plugin; add it before the compiler plugin.

Examples#

ts
import { importProtection } from "@shadow-js/dusk/vite";
importProtection(() => process.cwd(), { server: ["**\/*.secret.ts"] }); // a Vite plugin