{"compiled":"\"use strict\";\nconst {Fragment: _Fragment, jsx: _jsx, jsxs: _jsxs} = arguments[0];\nfunction _createMdxContent(props) {\n  const _components = {\n    a: \"a\",\n    br: \"br\",\n    code: \"code\",\n    figure: \"figure\",\n    h2: \"h2\",\n    h3: \"h3\",\n    p: \"p\",\n    pre: \"pre\",\n    span: \"span\",\n    strong: \"strong\",\n    ...props.components\n  }, {Box} = _components;\n  if (!Box) _missingMdxReference(\"Box\", true);\n  return _jsxs(_Fragment, {\n    children: [_jsxs(_components.p, {\n      children: [\"Including dependencies in a bundle not only increases capacity, but also increases compilation time.\", _jsx(_components.br, {}), \"\\n\", \"Serpack provides \", _jsx(_components.code, {\n        children: \"'external'\"\n      }), \" option that excludes \", _jsx(_components.code, {\n        children: \"node_modules\"\n      }), \" from bundle results to resolve this issue.\"]\n    }), \"\\n\", _jsx(_components.h2, {\n      children: \"In CLI\"\n    }), \"\\n\", _jsx(_components.figure, {\n      \"data-rehype-pretty-code-figure\": \"\",\n      children: _jsx(_components.pre, {\n        tabIndex: \"0\",\n        \"data-language\": \"bash\",\n        \"data-theme\": \"material-theme-palenight github-light\",\n        children: _jsx(_components.code, {\n          \"data-language\": \"bash\",\n          \"data-theme\": \"material-theme-palenight github-light\",\n          style: {\n            display: \"grid\"\n          },\n          children: _jsxs(_components.span, {\n            \"data-line\": \"\",\n            children: [_jsx(_components.span, {\n              style: {\n                \"--shiki-dark\": \"#FFCB6B\",\n                \"--shiki-light\": \"#6F42C1\"\n              },\n              children: \"npx\"\n            }), _jsx(_components.span, {\n              style: {\n                \"--shiki-dark\": \"#C3E88D\",\n                \"--shiki-light\": \"#032F62\"\n              },\n              children: \" serpack\"\n            }), _jsx(_components.span, {\n              style: {\n                \"--shiki-dark\": \"#C3E88D\",\n                \"--shiki-light\": \"#032F62\"\n              },\n              children: \" ./index.ts\"\n            }), _jsx(_components.span, {\n              style: {\n                \"--shiki-dark\": \"#C3E88D\",\n                \"--shiki-light\": \"#005CC5\"\n              },\n              children: \" --external\"\n            })]\n          })\n        })\n      })\n    }), \"\\n\", _jsxs(_components.p, {\n      children: [\"Enable \", _jsx(_components.code, {\n        children: \"--external\"\n      }), \" flag to exclude node_modules from bundle.\"]\n    }), \"\\n\", _jsx(_components.h2, {\n      children: \"In JavaScript\"\n    }), \"\\n\", _jsx(_components.h3, {\n      children: \"Exclude specific dependencies\"\n    }), \"\\n\", _jsx(_components.figure, {\n      \"data-rehype-pretty-code-figure\": \"\",\n      children: _jsx(_components.pre, {\n        tabIndex: \"0\",\n        \"data-language\": \"ts\",\n        \"data-theme\": \"material-theme-palenight github-light\",\n        children: _jsxs(_components.code, {\n          \"data-language\": \"ts\",\n          \"data-theme\": \"material-theme-palenight github-light\",\n          style: {\n            display: \"grid\"\n          },\n          children: [_jsxs(_components.span, {\n            \"data-line\": \"\",\n            children: [_jsx(_components.span, {\n              style: {\n                \"--shiki-dark\": \"#82AAFF\",\n                \"--shiki-light\": \"#6F42C1\"\n              },\n              children: \"compile\"\n            }), _jsx(_components.span, {\n              style: {\n                \"--shiki-dark\": \"#BABED8\",\n                \"--shiki-light\": \"#24292E\"\n              },\n              children: \"(\"\n            }), _jsx(_components.span, {\n              style: {\n                \"--shiki-dark\": \"#89DDFF\",\n                \"--shiki-light\": \"#032F62\"\n              },\n              children: \"'\"\n            }), _jsx(_components.span, {\n              style: {\n                \"--shiki-dark\": \"#C3E88D\",\n                \"--shiki-light\": \"#032F62\"\n              },\n              children: \"src/index.ts\"\n            }), _jsx(_components.span, {\n              style: {\n                \"--shiki-dark\": \"#89DDFF\",\n                \"--shiki-light\": \"#032F62\"\n              },\n              children: \"'\"\n            }), _jsx(_components.span, {\n              style: {\n                \"--shiki-dark\": \"#89DDFF\",\n                \"--shiki-light\": \"#24292E\"\n              },\n              children: \",\"\n            }), _jsx(_components.span, {\n              style: {\n                \"--shiki-dark\": \"#89DDFF\",\n                \"--shiki-light\": \"#24292E\"\n              },\n              children: \" {\"\n            })]\n          }), \"\\n\", _jsxs(_components.span, {\n            \"data-line\": \"\",\n            children: [_jsx(_components.span, {\n              style: {\n                \"--shiki-dark\": \"#F07178\",\n                \"--shiki-light\": \"#24292E\"\n              },\n              children: \"  externals\"\n            }), _jsx(_components.span, {\n              style: {\n                \"--shiki-dark\": \"#89DDFF\",\n                \"--shiki-light\": \"#24292E\"\n              },\n              children: \":\"\n            }), _jsx(_components.span, {\n              style: {\n                \"--shiki-dark\": \"#BABED8\",\n                \"--shiki-light\": \"#24292E\"\n              },\n              children: \" [\"\n            }), _jsx(_components.span, {\n              style: {\n                \"--shiki-dark\": \"#89DDFF\",\n                \"--shiki-light\": \"#032F62\"\n              },\n              children: \"'\"\n            }), _jsx(_components.span, {\n              style: {\n                \"--shiki-dark\": \"#C3E88D\",\n                \"--shiki-light\": \"#032F62\"\n              },\n              children: \"lodash\"\n            }), _jsx(_components.span, {\n              style: {\n                \"--shiki-dark\": \"#89DDFF\",\n                \"--shiki-light\": \"#032F62\"\n              },\n              children: \"'\"\n            }), _jsx(_components.span, {\n              style: {\n                \"--shiki-dark\": \"#89DDFF\",\n                \"--shiki-light\": \"#24292E\"\n              },\n              children: \",\"\n            }), _jsx(_components.span, {\n              style: {\n                \"--shiki-dark\": \"#89DDFF\",\n                \"--shiki-light\": \"#032F62\"\n              },\n              children: \" '\"\n            }), _jsx(_components.span, {\n              style: {\n                \"--shiki-dark\": \"#C3E88D\",\n                \"--shiki-light\": \"#032F62\"\n              },\n              children: \"axios\"\n            }), _jsx(_components.span, {\n              style: {\n                \"--shiki-dark\": \"#89DDFF\",\n                \"--shiki-light\": \"#032F62\"\n              },\n              children: \"'\"\n            }), _jsx(_components.span, {\n              style: {\n                \"--shiki-dark\": \"#BABED8\",\n                \"--shiki-light\": \"#24292E\"\n              },\n              children: \"]\"\n            }), _jsx(_components.span, {\n              style: {\n                \"--shiki-dark\": \"#89DDFF\",\n                \"--shiki-light\": \"#24292E\"\n              },\n              children: \",\"\n            })]\n          }), \"\\n\", _jsxs(_components.span, {\n            \"data-line\": \"\",\n            children: [_jsx(_components.span, {\n              style: {\n                \"--shiki-dark\": \"#89DDFF\",\n                \"--shiki-light\": \"#24292E\"\n              },\n              children: \"}\"\n            }), _jsx(_components.span, {\n              style: {\n                \"--shiki-dark\": \"#BABED8\",\n                \"--shiki-light\": \"#24292E\"\n              },\n              children: \")\"\n            }), _jsx(_components.span, {\n              style: {\n                \"--shiki-dark\": \"#89DDFF\",\n                \"--shiki-light\": \"#24292E\"\n              },\n              children: \";\"\n            })]\n          })]\n        })\n      })\n    }), \"\\n\", _jsx(_components.h3, {\n      children: \"Exclude ALL node_modules\"\n    }), \"\\n\", _jsx(_components.figure, {\n      \"data-rehype-pretty-code-figure\": \"\",\n      children: _jsx(_components.pre, {\n        tabIndex: \"0\",\n        \"data-language\": \"ts\",\n        \"data-theme\": \"material-theme-palenight github-light\",\n        children: _jsxs(_components.code, {\n          \"data-language\": \"ts\",\n          \"data-theme\": \"material-theme-palenight github-light\",\n          style: {\n            display: \"grid\"\n          },\n          children: [_jsxs(_components.span, {\n            \"data-line\": \"\",\n            children: [_jsx(_components.span, {\n              style: {\n                \"--shiki-dark\": \"#82AAFF\",\n                \"--shiki-light\": \"#6F42C1\"\n              },\n              children: \"compile\"\n            }), _jsx(_components.span, {\n              style: {\n                \"--shiki-dark\": \"#BABED8\",\n                \"--shiki-light\": \"#24292E\"\n              },\n              children: \"(\"\n            }), _jsx(_components.span, {\n              style: {\n                \"--shiki-dark\": \"#89DDFF\",\n                \"--shiki-light\": \"#032F62\"\n              },\n              children: \"'\"\n            }), _jsx(_components.span, {\n              style: {\n                \"--shiki-dark\": \"#C3E88D\",\n                \"--shiki-light\": \"#032F62\"\n              },\n              children: \"src/index.ts\"\n            }), _jsx(_components.span, {\n              style: {\n                \"--shiki-dark\": \"#89DDFF\",\n                \"--shiki-light\": \"#032F62\"\n              },\n              children: \"'\"\n            }), _jsx(_components.span, {\n              style: {\n                \"--shiki-dark\": \"#89DDFF\",\n                \"--shiki-light\": \"#24292E\"\n              },\n              children: \",\"\n            }), _jsx(_components.span, {\n              style: {\n                \"--shiki-dark\": \"#89DDFF\",\n                \"--shiki-light\": \"#24292E\"\n              },\n              children: \" {\"\n            })]\n          }), \"\\n\", _jsxs(_components.span, {\n            \"data-line\": \"\",\n            children: [_jsx(_components.span, {\n              style: {\n                \"--shiki-dark\": \"#F07178\",\n                \"--shiki-light\": \"#24292E\"\n              },\n              children: \"  nodeExternal\"\n            }), _jsx(_components.span, {\n              style: {\n                \"--shiki-dark\": \"#89DDFF\",\n                \"--shiki-light\": \"#24292E\"\n              },\n              children: \":\"\n            }), _jsx(_components.span, {\n              style: {\n                \"--shiki-dark\": \"#FF9CAC\",\n                \"--shiki-light\": \"#005CC5\"\n              },\n              children: \" true\"\n            }), _jsx(_components.span, {\n              style: {\n                \"--shiki-dark\": \"#89DDFF\",\n                \"--shiki-light\": \"#24292E\"\n              },\n              children: \",\"\n            }), _jsx(_components.span, {\n              style: {\n                \"--shiki-dark\": \"#676E95\",\n                \"--shiki-dark-font-style\": \"italic\",\n                \"--shiki-light\": \"#6A737D\",\n                \"--shiki-light-font-style\": \"inherit\"\n              },\n              children: \" // default: false\"\n            })]\n          }), \"\\n\", _jsxs(_components.span, {\n            \"data-line\": \"\",\n            children: [_jsx(_components.span, {\n              style: {\n                \"--shiki-dark\": \"#89DDFF\",\n                \"--shiki-light\": \"#24292E\"\n              },\n              children: \"}\"\n            }), _jsx(_components.span, {\n              style: {\n                \"--shiki-dark\": \"#BABED8\",\n                \"--shiki-light\": \"#24292E\"\n              },\n              children: \")\"\n            }), _jsx(_components.span, {\n              style: {\n                \"--shiki-dark\": \"#89DDFF\",\n                \"--shiki-light\": \"#24292E\"\n              },\n              children: \";\"\n            })]\n          })]\n        })\n      })\n    }), \"\\n\", _jsx(_components.h3, {\n      children: \"Force External\"\n    }), \"\\n\", _jsxs(_components.p, {\n      children: [\"The \", _jsx(_components.a, {\n        href: \"#exclude-specific-dependencies\",\n        children: _jsx(_components.code, {\n          children: \"externals\"\n        })\n      }), \" works by finding the dependency's \", _jsx(_components.code, {\n        children: \"package.json\"\n      }), \" through the resolver and excluding it if it matches the \", _jsx(_components.code, {\n        children: \"name\"\n      }), \" field of \", _jsx(_components.code, {\n        children: \"package.json\"\n      }), \".\"]\n    }), \"\\n\", _jsxs(_components.p, {\n      children: [\"To skip this process and directly compare the path in \", _jsx(_components.code, {\n        children: \"import\"\n      }), \" or \", _jsx(_components.code, {\n        children: \"require\"\n      }), \" statements (e.g., \", _jsx(_components.code, {\n        children: \"require(\\\"my-pkg\\\") => my-pkg\"\n      }), \") without using the resolver,\\nuse the force external option.\"]\n    }), \"\\n\", _jsx(_components.figure, {\n      \"data-rehype-pretty-code-figure\": \"\",\n      children: _jsx(_components.pre, {\n        tabIndex: \"0\",\n        \"data-language\": \"ts\",\n        \"data-theme\": \"material-theme-palenight github-light\",\n        children: _jsxs(_components.code, {\n          \"data-language\": \"ts\",\n          \"data-theme\": \"material-theme-palenight github-light\",\n          style: {\n            display: \"grid\"\n          },\n          children: [_jsxs(_components.span, {\n            \"data-line\": \"\",\n            children: [_jsx(_components.span, {\n              style: {\n                \"--shiki-dark\": \"#82AAFF\",\n                \"--shiki-light\": \"#6F42C1\"\n              },\n              children: \"compile\"\n            }), _jsx(_components.span, {\n              style: {\n                \"--shiki-dark\": \"#BABED8\",\n                \"--shiki-light\": \"#24292E\"\n              },\n              children: \"(\"\n            }), _jsx(_components.span, {\n              style: {\n                \"--shiki-dark\": \"#89DDFF\",\n                \"--shiki-light\": \"#032F62\"\n              },\n              children: \"'\"\n            }), _jsx(_components.span, {\n              style: {\n                \"--shiki-dark\": \"#C3E88D\",\n                \"--shiki-light\": \"#032F62\"\n              },\n              children: \"src/index.ts\"\n            }), _jsx(_components.span, {\n              style: {\n                \"--shiki-dark\": \"#89DDFF\",\n                \"--shiki-light\": \"#032F62\"\n              },\n              children: \"'\"\n            }), _jsx(_components.span, {\n              style: {\n                \"--shiki-dark\": \"#89DDFF\",\n                \"--shiki-light\": \"#24292E\"\n              },\n              children: \",\"\n            }), _jsx(_components.span, {\n              style: {\n                \"--shiki-dark\": \"#89DDFF\",\n                \"--shiki-light\": \"#24292E\"\n              },\n              children: \" {\"\n            })]\n          }), \"\\n\", _jsxs(_components.span, {\n            \"data-line\": \"\",\n            children: [_jsx(_components.span, {\n              style: {\n                \"--shiki-dark\": \"#F07178\",\n                \"--shiki-light\": \"#24292E\"\n              },\n              children: \"  forceExternal\"\n            }), _jsx(_components.span, {\n              style: {\n                \"--shiki-dark\": \"#89DDFF\",\n                \"--shiki-light\": \"#24292E\"\n              },\n              children: \":\"\n            }), _jsx(_components.span, {\n              style: {\n                \"--shiki-dark\": \"#BABED8\",\n                \"--shiki-light\": \"#24292E\"\n              },\n              children: \" [\"\n            }), _jsx(_components.span, {\n              style: {\n                \"--shiki-dark\": \"#89DDFF\",\n                \"--shiki-light\": \"#032F62\"\n              },\n              children: \"'\"\n            }), _jsx(_components.span, {\n              style: {\n                \"--shiki-dark\": \"#C3E88D\",\n                \"--shiki-light\": \"#032F62\"\n              },\n              children: \"my-workspace\"\n            }), _jsx(_components.span, {\n              style: {\n                \"--shiki-dark\": \"#89DDFF\",\n                \"--shiki-light\": \"#032F62\"\n              },\n              children: \"'\"\n            }), _jsx(_components.span, {\n              style: {\n                \"--shiki-dark\": \"#BABED8\",\n                \"--shiki-light\": \"#24292E\"\n              },\n              children: \"]\"\n            }), _jsx(_components.span, {\n              style: {\n                \"--shiki-dark\": \"#89DDFF\",\n                \"--shiki-light\": \"#24292E\"\n              },\n              children: \",\"\n            })]\n          }), \"\\n\", _jsxs(_components.span, {\n            \"data-line\": \"\",\n            children: [_jsx(_components.span, {\n              style: {\n                \"--shiki-dark\": \"#89DDFF\",\n                \"--shiki-light\": \"#24292E\"\n              },\n              children: \"}\"\n            }), _jsx(_components.span, {\n              style: {\n                \"--shiki-dark\": \"#BABED8\",\n                \"--shiki-light\": \"#24292E\"\n              },\n              children: \")\"\n            }), _jsx(_components.span, {\n              style: {\n                \"--shiki-dark\": \"#89DDFF\",\n                \"--shiki-light\": \"#24292E\"\n              },\n              children: \";\"\n            })]\n          })]\n        })\n      })\n    }), \"\\n\", _jsx(_components.p, {\n      children: \"This can contribute to a slight performance improvement.\"\n    }), \"\\n\", _jsx(Box, {\n      type: \"error\",\n      children: _jsxs(_components.p, {\n        children: [\"This option is no longer supported. After \", _jsx(_components.strong, {\n          children: \"v0.1.10\"\n        }), \", its functionality is no longer\\nguaranteed.\"]\n      })\n    })]\n  });\n}\nfunction MDXContent(props = {}) {\n  const {wrapper: MDXLayout} = props.components || ({});\n  return MDXLayout ? _jsx(MDXLayout, {\n    ...props,\n    children: _jsx(_createMdxContent, {\n      ...props\n    })\n  }) : _createMdxContent(props);\n}\nreturn {\n  default: MDXContent\n};\nfunction _missingMdxReference(id, component) {\n  throw new Error(\"Expected \" + (component ? \"component\" : \"object\") + \" `\" + id + \"` to be defined: you likely forgot to import, pass, or provide it.\");\n}\n","posts":[{"introduction":"Introduction"},{"comparison":"Comparison"},{"serpackrc":".serpackrc.js"},{"compile":"Compile"},{"options":"Compiler Options"},{"runtime":"serpack/runtime"},{"sourcemap":"Sourcemap"},{"externals":"Exclude node_modules"},{"extension":"Supported Extensions"},{"modifier":"Modifier"},{"plugin-guide":"Plugin Guide"},{"generate-d-ts":"Generate .d.ts"},{"serpack-only":"serpack-only Feature"},{"debug":"Debugging Mode"},{"roadmap":"Roadmap"}],"target":{"externals":"Exclude node_modules"},"targetcategory":"APIs","directory":"serpack"}