vite-plugin-module-list
Ƭ Mode: ModeJs
| ModeTs
| ModeCss
Generation mode.
Ƭ ModeCss: Object
CSS mode.
Name | Type | Description |
---|---|---|
language |
"css" |
Generate a CSS module. |
Ƭ ModeJs: Object
JavaScript mode.
Name | Type | Description |
---|---|---|
dynamic? |
true |
Generate a module that dynamically imports the module. |
extension? |
true |
Include the module file name extension when importing the module. |
language |
"js" |
Generate a JavaScript module. |
Ƭ ModeTs: Object
TypeScript mode.
Name | Type | Description |
---|---|---|
dynamic? |
true |
Generate a module that dynamically imports the module. |
extension? |
true |
Include the module file name extension when importing the module. |
language |
"ts" |
Generate a TypeScript module. |
type? |
true |
Use the type keyword when importing the module. |
Ƭ ModuleListOptions: Object
Plugin options.
Name | Type | Description |
---|---|---|
exclude? |
RegExp |
Regular expression that matches file names to exclude. Files that match the include regular expression but match the exclude regular expression will be excluded. Default Value /\.(?:tests?|spec)\.[^.]+$/ |
formatOptions? |
FormatOptions | false |
Prettier options. If explicitely set to false, the code is not formatted. See FormatOptions for the list of options. |
include? |
RegExp |
Regular expression that matches file names to include. Files that do not match will be excluded. Default Value /(?:)/ |
includeExtensions? |
string [] |
Module file name extensions to include. Files with other extensions are ignored. Default Value ["js", "ts", "jsx", "tsx"] |
mode? |
Mode | Mode ["language" ] |
Specifies how the modules are listed and exported. Default Value ts "js" |
outputPath? |
string |
Path to the module into wich the module list is written. Default Value ${rootPath}/main.ts . |
rootPath? |
string |
Path to the folder containing the modules to list. Default Value "." |
▸ default(options
): PluginOption
Vite plugin that writes a module that imports modules found in a folder.
Name | Type | Description |
---|---|---|
options |
ModuleListOptions |
See ModuleListOptions |
PluginOption
A vite plugin that writes a module that imports modules found in a folder.