Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Export AllNew to Visual Studio Code? Get it now.
Export All

Export All

Madoka

|
414 installs
| (0) | Free
Export all files from folder
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Export All

Generate export statements for all files in the current directory.

Usage

  1. Open or create your index.ts
  2. Run exportAll: Export all files in current folder from the command palette
  3. Run again to append only new files — existing exports are skipped

Example

src/components/
  Button.tsx
  Modal.tsx
  utils/
    index.ts
  logo.png
  arrow-right.svg
  index.ts        <-- run here

Default output:

export * from './Button'
export * from './Modal'
export * from './utils'

With assetExportMap configured (see Asset Exports):

export { default as imgLogo } from './logo.png'
export { default as arrowRightIcon } from './arrow-right.svg'

Defaults

  • Skips hidden files (. prefix)
  • Skips .d.*, .test.*, .spec.*, .e2e.* files (matched against source extensions)
  • Skips node_modules, __tests__, __mocks__, dist, out, build
  • Only exports subdirectories that contain an index file
  • Quote style follows existing code

Configuration

extra* settings add to defaults; include* settings remove from defaults.

Source Extensions

{ "exportAll.extraSourceExtensions": [".vue", ".svelte", ".mjs"] }

Built-in: .ts, .tsx, .js, .jsx.

Ignore Rules

Extra excludes:

{
  "exportAll.extraExcludeFilePatterns": ["\\.stories\\."],
  "exportAll.extraExcludeDirectories": ["fixtures"]
}

Bring back from default excludes:

{
  "exportAll.includeFilePatterns": [".test."],
  "exportAll.includeDirectories": ["dist"]
}

Asset Exports

Configure via assetExportMap. Keys can be preset names or comma-separated extensions:

{
  "exportAll.assetExportMap": {
    "image": "img{pascal}",
    "svg": "{camel}Icon"
  }
}

Built-in presets:

Preset Extensions
image .png, .jpg, .jpeg, .gif, .webp, .avif, .bmp, .ico
svg .svg
font .woff, .woff2, .ttf, .eot, .otf
media .mp3, .mp4, .ogg, .wav, .webm

You can also use comma-separated extensions directly: ".png,.jpg": "img{pascal}".

Available placeholders:

Placeholder home-banner
{camel} homeBanner
{pascal} HomeBanner
{snake} home_banner
{CONSTANT} HOME_BANNER

With the config above:

  • home-banner.png → export { default as imgHomeBanner } from './home-banner.png'
  • arrow-right.svg → export { default as arrowRightIcon } from './arrow-right.svg'

Export All(中文)

为当前目录下所有文件生成 export 语句。

用法

  1. 打开或创建 index.ts
  2. 命令面板执行 exportAll: Export all files in current folder
  3. 再次执行只会追加新文件,已有的不会重复

示例

src/components/
  Button.tsx
  Modal.tsx
  utils/
    index.ts
  logo.png
  arrow-right.svg
  index.ts        <-- 在这里执行

默认输出:

export * from './Button'
export * from './Modal'
export * from './utils'

配置 assetExportMap 后(见资源文件导出):

export { default as imgLogo } from './logo.png'
export { default as arrowRightIcon } from './arrow-right.svg'

默认行为

  • 跳过隐藏文件(. 开头)
  • 跳过 .d.*、.test.*、.spec.*、.e2e.* 文件(基于源码后缀匹配)
  • 跳过 node_modules、__tests__、__mocks__、dist、out、build
  • 子目录需包含 index 文件才会导出
  • 引号风格跟随已有代码

配置

extra* 配置在默认值基础上追加;include* 配置可从默认排除列表中移除指定项。

源码后缀

{ "exportAll.extraSourceExtensions": [".vue", ".svelte", ".mjs"] }

默认支持 .ts、.tsx、.js、.jsx。

忽略规则

额外排除:

{
  "exportAll.extraExcludeFilePatterns": ["\\.stories\\."],
  "exportAll.extraExcludeDirectories": ["fixtures"]
}

从默认排除中捞回来:

{
  "exportAll.includeFilePatterns": [".test."],
  "exportAll.includeDirectories": ["dist"]
}

资源文件导出

通过 assetExportMap 配置,key 可以是预设名或逗号分隔的后缀:

{
  "exportAll.assetExportMap": {
    "image": "img{pascal}",
    "svg": "{camel}Icon"
  }
}

内置预设:

预设 包含后缀
image .png, .jpg, .jpeg, .gif, .webp, .avif, .bmp, .ico
svg .svg
font .woff, .woff2, .ttf, .eot, .otf
media .mp3, .mp4, .ogg, .wav, .webm

也可以直接用逗号分隔后缀:".png,.jpg": "img{pascal}"。

可用占位符:

占位符 home-banner 的结果
{camel} homeBanner
{pascal} HomeBanner
{snake} home_banner
{CONSTANT} HOME_BANNER

以上配置的效果:

  • home-banner.png → export { default as imgHomeBanner } from './home-banner.png'
  • arrow-right.svg → export { default as arrowRightIcon } from './arrow-right.svg'
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
  • Your Privacy Choices
  • Consumer Health Privacy
© 2026 Microsoft