Skip to main content

@lexical/compiler/SubpathImports

Interfaces

SubpathImportsOptions

Defined in: packages/lexical-compiler/src/SubpathImports.ts:13

Properties

packages?

optional packages?: readonly string[]

Defined in: packages/lexical-compiler/src/SubpathImports.ts:15

Package names or paths to package.json files. Defaults to ['@lexical/extension'].

root?

optional root?: string

Defined in: packages/lexical-compiler/src/SubpathImports.ts:17

Resolve package names from this directory. Defaults to process.cwd().

strict?

optional strict?: boolean

Defined in: packages/lexical-compiler/src/SubpathImports.ts:19

Reject runtime barrel access that cannot be narrowed (namespace, dynamic, require, side-effect or star imports). Defaults to false.


SubpathImportsPlugin

Defined in: packages/lexical-compiler/src/SubpathImports.ts:23

Structural interface compatible with Rollup and Vite, without a runtime dependency on either.

Properties

enforce

enforce: "pre"

Defined in: packages/lexical-compiler/src/SubpathImports.ts:25

name

name: string

Defined in: packages/lexical-compiler/src/SubpathImports.ts:24

Methods

buildStart()

buildStart(this): void

Defined in: packages/lexical-compiler/src/SubpathImports.ts:26

Parameters
this
addWatchFile
Returns

void

shouldTransformCachedModule()

shouldTransformCachedModule(): boolean

Defined in: packages/lexical-compiler/src/SubpathImports.ts:27

Returns

boolean

transform()

transform(code, id): { code: string; map: SourceMap; } | null

Defined in: packages/lexical-compiler/src/SubpathImports.ts:28

Parameters
code

string

id

string

Returns

{ code: string; map: SourceMap; } | null

Variables

subpathImports

const subpathImports: (options?) => SubpathImportsPlugin = impl.subpathImports

Defined in: packages/lexical-compiler/src/SubpathImports.ts:38

Rewrite named barrel imports to public subpaths before dependency resolution.

Parameters

options?

SubpathImportsOptions

Returns

SubpathImportsPlugin