---
title: "Discussion on \"JS: Barrel file隱含的問題\n\" | Hashnode"
description: "Discussion on \"JS: Barrel file隱含的問題\n\". 以前實習時候學到用barrel file管理模組，因為可以讓模組管理變得很一目了然、import的時候可以一行引入多個模組，所以工作後仍持續使用barrel file，結果後來才發現barrel file其實藏有蠻多潛在問題：\n降低開發體驗\n以Vite開發模式來說，即便只引用barrel file內其中一個模組，Vite在初始化的時候需要時間去解析和轉換barrel file裡面所有export出"
url: "https://hashnode.com/posts/js-barrel-file-issue/699c39421ff70686f28c7928"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [JS: Barrel file隱含的問題](https://urlun0404.hashnode.dev/js-barrel-file-issue?utm_source=hashnode&utm_medium=feed)

以前實習時候學到用barrel file管理模組，因為可以讓模組管理變得很一目了然、import的時候可以一行引入多個模組，所以工作後仍持續使用barrel file，結果後來才發現barrel file其實藏有蠻多潛在問題： 降低開發體驗 以Vite開發模式來說，即便只引用barrel file內其中一個模組，Vite在初始化的時候需要時間去解析和轉換barrel file裡面所有export出

Feb 23 · 2 min read · urlun0404.hashnode.dev  
Updated Mar 3  
Read the article

-   [#javascript](https://hashnode.com/tag/javascript)
-   [#typescript](https://hashnode.com/tag/typescript)

## Written by

[You-Lun Lin](https://hashnode.com/@urlun0404)

@urlun0404 · New Taipei, Taiwan

  
[View profile](https://hashnode.com/@urlun0404)

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
