1"use strict";(self.rspackChunkrspack_website=self.rspackChunkrspack_website||[]).push([["fk"],{lC(e,s,r){r.r(s);var n=r("i"),i=r("f"),o=r("V"),l=r("No");function a(e){let s={a:"a",blockquote:"blockquote",code:"code",em:"em",h1:"h1",h2:"h2",h3:"h3",h4:"h4",hr:"hr",img:"img",li:"li",p:"p",pre:"pre",span:"span",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,i.R)(),...e.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(s.h1,{id:"announcing-rspack-16",children:[(0,n.jsx)(s.a,{className:"rp-header-anchor","aria-hidden":"true",href:"#announcing-rspack-16",children:"#"}),"Announcing Rspack 1.6"]}),"\n",(0,n.jsx)(s.p,{children:(0,n.jsx)(s.em,{children:"October 30, 2025"})}),"\n",(0,n.jsx)(l.d,{}),"\n",(0,n.jsx)(s.p,{children:(0,n.jsx)(s.img,{src:"https://assets.rspack.rs/rspack/rspack-banner-v1-6.png",alt:"Rspack 1.6"})}),"\n",(0,n.jsx)(s.hr,{}),"\n",(0,n.jsx)(s.p,{children:"We are excited to announce Rspack 1.6!"}),"\n",(0,n.jsx)(s.p,{children:"Notable changes include:"}),"\n",(0,n.jsxs)(s.ul,{children:["\n",(0,n.jsxs)(s.li,{children:["New Features","\n",(0,n.jsxs)(s.ul,{children:["\n",(0,n.jsx)(s.li,{children:(0,n.jsx)(s.a,{href:"#enhanced-tree-shaking",children:"Enhanced tree shaking"})}),"\n",(0,n.jsx)(s.li,{children:(0,n.jsx)(s.a,{href:"#support-for-import-defer",children:"Support for import defer"})}),"\n",(0,n.jsx)(s.li,{children:(0,n.jsx)(s.a,{href:"#improved-esm-output",children:"Improved ESM output"})}),"\n",(0,n.jsx)(s.li,{children:(0,n.jsx)(s.a,{href:"#optimized-barrels-by-default",children:"Optimized barrels by default"})}),"\n",(0,n.jsx)(s.li,{children:(0,n.jsx)(s.a,{href:"#stabilized-layers-feature",children:"Stabilized layers feature"})}),"\n",(0,n.jsx)(s.li,{children:(0,n.jsx)(s.a,{href:"#preserve-jsx-syntax",children:"Preserve JSX syntax"})}),"\n",(0,n.jsx)(s.li,{children:(0,n.jsx)(s.a,{href:"#extract-source-map",children:"Extract source map"})}),"\n",(0,n.jsx)(s.li,{children:(0,n.jsx)(s.a,{href:"#performance-improvements",children:"Performance improvements"})}),"\n"]}),"\n"]}),"\n",(0,n.jsxs)(s.li,{children:["Rstack Progress","\n",(0,n.jsxs)(s.ul,{children:["\n",(0,n.jsx)(s.li,{children:(0,n.jsx)(s.a,{href:"#rsbuild-16",children:"Rsbuild 1.6"})}),"\n",(0,n.jsx)(s.li,{children:(0,n.jsx)(s.a,{href:"#rspress-v2-beta",children:"Rspress v2 beta"})}),"\n",(0,n.jsx)(s.li,{children:(0,n.jsx)(s.a,{href:"#rslib-016",children:"Rslib 0.16"})}),"\n",(0,n.jsx)(s.li,{children:(0,n.jsx)(s.a,{href:"#rstest-06",children:"Rstest 0.6"})}),"\n",(0,n.jsx)(s.li,{children:(0,n.jsx)(s.a,{href:"#rsdoctor-13",children:"Rsdoctor 1.3"})}),"\n"]}),"\n"]}),"\n",(0,n.jsxs)(s.li,{children:["Ecosystem","\n",(0,n.jsxs)(s.ul,{children:["\n",(0,n.jsx)(s.li,{children:(0,n.jsx)(s.a,{href:"#next-rspack",children:"next-rspack"})}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,n.jsxs)(s.h2,{id:"new-features",children:[(0,n.jsx)(s.a,{className:"rp-header-anchor","aria-hidden":"true",href:"#new-features",children:"#"}),"New features"]}),"\n",(0,n.jsxs)(s.h3,{id:"enhanced-tree-shaking",children:[(0,n.jsx)(s.a,{className:"rp-header-anchor","aria-hidden":"true",href:"#enhanced-tree-shaking",children:"#"}),"Enhanced tree shaking"]}),"\n",(0,n.jsx)(s.p,{children:"Rspack 1.6 improved tree shaking support for dynamic imports. In previous versions, Rspack could only perform tree shaking on destructured assignments within dynamic imports, while other import patterns were not analyzed."}),"\n",(0,n.jsx)(s.p,{children:"Now, Rspack introduces comprehensive static analysis for dynamic imports. It can recognize and handle a wider range of usage patterns. This allows Rspack to precisely eliminate unused exports and further reduce the size of the final bundle."}),"\n",(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(s.pre,{className:"shiki css-variables",style:{backgroundColor:"var(--shiki-background)",color:"var(--shiki-foreground)"},tabIndex:"0",lang:"js",children:(0,n.jsxs)(s.code,{children:[(0,n.jsx)(s.span,{className:"line",children:(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-comment)"},children:"// Rspack 1.5 â Only supported destructured imports"})}),"\n",(0,n.jsxs)(s.span,{className:"line",children:[(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-keyword)"},children:"const"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:" { "}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-constant)"},children:"value"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:" } "}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-keyword)"},children:"="}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-keyword)"},children:" await"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-keyword)"},children:" import"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:"("}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-string-expression)"},children:"'./module'"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:");"})]}),"\n",(0,n.jsxs)(s.span,{className:"line",children:[(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-constant)"},children:"console"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-function)"},children:".log"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:"(value);"})]}),"\n",(0,n.jsx)(s.span,{className:"line"}),"\n",(0,n.jsx)(s.span,{className:"line",children:(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-comment)"},children:"// Rspack 1.6 â Now supports the following cases"})}),"\n",(0,n.jsx)(s.span,{className:"line",children:(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-comment)"},children:"// Case 1"})}),"\n",(0,n.jsxs)(s.span,{className:"line",children:[(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-keyword)"},children:"const"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-constant)"},children:" mod"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-keyword)"},children:" ="}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-keyword)"},children:" await"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-keyword)"},children:" import"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:"("}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-string-expression)"},children:"'./module'"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:");"})]}),"\n",(0,n.jsxs)(s.span,{className:"line",children:[(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-keyword)"},children:"const"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:" { "}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-constant)"},children:"value"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:" } "}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-keyword)"},children:"="}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:" mod;"})]}),"\n",(0,n.jsxs)(s.span,{className:"line",children:[(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-constant)"},children:"console"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-function)"},children:".log"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:"(value);"})]}),"\n",(0,n.jsx)(s.span,{className:"line"}),"\n",(0,n.jsx)(s.span,{className:"line",children:(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-comment)"},children:"// Case 2"})}),"\n",(0,n.jsxs)(s.span,{className:"line",children:[(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-keyword)"},children:"const"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-constant)"},children:" mod"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-keyword)"},children:" ="}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-keyword)"},children:" await"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-keyword)"},children:" import"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:"("}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-string-expression)"},children:"'./module'"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:");"})]}),"\n",(0,n.jsxs)(s.span,{className:"line",children:[(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-constant)"},children:"console"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-function)"},children:".log"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:"("}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-constant)"},children:"mod"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:".value);"})]}),"\n",(0,n.jsx)(s.span,{className:"line"}),"\n",(0,n.jsx)(s.span,{className:"line",children:(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-comment)"},children:"// Case 3"})}),"\n",(0,n.jsxs)(s.span,{className:"line",children:[(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-keyword)"},children:"import"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:"("}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-string-expression)"},children:"'./module'"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:")"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-function)"},children:".then"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:"(({ value }) "}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-keyword)"},children:"=>"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:" {"})]}),"\n",(0,n.jsxs)(s.span,{className:"line",children:[(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-constant)"},children:" console"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-function)"},children:".log"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:"(value);"})]}),"\n",(0,n.jsx)(s.span,{className:"line",children:(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:"});"})}),"\n",(0,n.jsx)(s.span,{className:"line"}),"\n",(0,n.jsx)(s.span,{className:"line",children:(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-comment)"},children:"// Case 4"})}),"\n",(0,n.jsxs)(s.span,{className:"line",children:[(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-keyword)"},children:"import"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:"("}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-string-expression)"},children:"'./module'"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:")"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-function)"},children:".then"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:"((mod) "}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-keyword)"},children:"=>"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:" {"})]}),"\n",(0,n.jsxs)(s.span,{className:"line",children:[(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-keyword)"},children:" const"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:" { "}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-constant)"},children:"value"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:" } "}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-keyword)"},children:"="}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:" mod;"})]}),"\n",(0,n.jsxs)(s.span,{className:"line",children:[(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-constant)"},children:" console"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-function)"},children:".log"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:"(value);"})]}),"\n",(0,n.jsx)(s.span,{className:"line",children:(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:"});"})}),"\n",(0,n.jsx)(s.span,{className:"line"}),"\n",(0,n.jsx)(s.span,{className:"line",children:(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-comment)"},children:"// Case 5"})}),"\n",(0,n.jsxs)(s.span,{className:"line",children:[(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-keyword)"},children:"import"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:"("}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-string-expression)"},children:"'./module'"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:")"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-function)"},children:".then"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:"((mod) "}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-keyword)"},children:"=>"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:" {"})]}),"\n",(0,n.jsxs)(s.span,{className:"line",children:[(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-constant)"},children:" console"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-function)"},children:".log"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:"("}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-constant)"},children:"mod"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:".value);"})]}),"\n",(0,n.jsx)(s.span,{className:"line",children:(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:"});"})})]})})}),"\n",(0,n.jsxs)(s.h3,{id:"support-for-import-defer",children:[(0,n.jsx)(s.a,{className:"rp-header-anchor","aria-hidden":"true",href:"#support-for-import-defer",children:"#"}),"Support for import defer"]}),"\n",(0,n.jsxs)(s.p,{children:["Rspack now supports the ",(0,n.jsx)(s.a,{href:"https://github.com/tc39/proposal-defer-import-eval",rel:"noopener noreferrer",target:"_blank",children:"import defer"})," syntax."]}),"\n",(0,n.jsxs)(s.p,{children:[(0,n.jsx)(s.code,{children:"import defer"}
1)," is a new feature in JavaScript, which is also supported in ",(0,n.jsx)(s.a,{href:"https://devblogs.microsoft.com/typescript/announcing-typescript-5-9-beta/#support-for-import-defer",rel:"noopener noreferrer",target:"_blank",children:"TypeScript 5.9"}),". It allows you to import a module without immediately executing the module and its dependencies, giving you better control over when code execution and side effects occur."]}),"\n",(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(s.pre,{className:"shiki css-variables",style:{backgroundColor:"var(--shiki-background)",color:"var(--shiki-foreground)"},tabIndex:"0",lang:"js",children:(0,n.jsx)(s.code,{children:(0,n.jsxs)(s.span,{className:"line",children:[(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-keyword)"},children:"import"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:" defer "}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-constant)"},children:"*"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-keyword)"},children:" as"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:" foo "}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-keyword)"},children:"from"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-string-expression)"},children:" './foo'"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:";"})]})})})}),"\n",(0,n.jsxs)(s.p,{children:["You can enable this feature through ",(0,n.jsx)(s.a,{href:"/config/experiments.html#experimentsdeferimport",children:"experiments.deferImport"}),":"]}),"\n",(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(s.pre,{className:"shiki css-variables",style:{backgroundColor:"var(--shiki-background)",color:"var(--shiki-foreground)"},tabIndex:"0",title:"rspack.config.mjs",lang:"js",children:(0,n.jsxs)(s.code,{children:[(0,n.jsxs)(s.span,{className:"line",children:[(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-keyword)"},children:"export"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-keyword)"},children:" default"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:" {"})]}),"\n",(0,n.jsxs)(s.span,{className:"line",children:[(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:" experiments"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-keyword)"},children:":"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:" {"})]}),"\n",(0,n.jsxs)(s.span,{className:"line",children:[(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:" deferImport"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-keyword)"},children:":"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-constant)"},children:" true"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-punctuation)"},children:","})]}),"\n",(0,n.jsxs)(s.span,{className:"line",children:[(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:" }"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-punctuation)"},children:","})]}),"\n",(0,n.jsx)(s.span,{className:"line",children:(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:"};"})})]})})}),"\n",(0,n.jsxs)(s.blockquote,{children:["\n",(0,n.jsxs)(s.p,{children:["Currently, Rspack only supports the ",(0,n.jsx)(s.code,{children:"import defer"})," syntax. The function form ",(0,n.jsx)(s.code,{children:"import.defer()"})," will be implemented in future versions."]}),"\n"]}),"\n",(0,n.jsxs)(s.h3,{id:"improved-esm-output",children:[(0,n.jsx)(s.a,{className:"rp-header-anchor","aria-hidden":"true",href:"#improved-esm-output",children:"#"}),"Improved ESM output"]}),"\n",(0,n.jsxs)(s.p,{children:["Optimizing ESM output has long been one of the key challenges faced by Rspack. Previously, we relied on ",(0,n.jsx)(s.a,{href:"/config/optimization.html#optimizationconcatenatemodules",children:"module concatenation"})," to optimize ESM outputs, but that approach had several limitations:"]}),"\n",(0,n.jsxs)(s.ul,{children:["\n",(0,n.jsxs)(s.li,{children:[(0,n.jsx)(s.strong,{children:"Impure output"})," â The generated files contained Rspack's runtime code."]}),"\n",(0,n.jsxs)(s.li,{children:[(0,n.jsx)(s.strong,{children:"Prone to errors"})," â Some modules could not be correctly concatenated, leading to unexpected runtime issues."]}),"\n",(0,n.jsxs)(s.li,{children:[(0,n.jsx)(s.strong,{children:"Limited code-splitting support"})," â Split bundles became complex and difficult to analyze or optimize statically."]}),"\n"]}),"\n",(0,n.jsxs)(s.p,{children:["To address these issues once and for all, we introduced an experimental plugin called ",(0,n.jsx)(s.a,{href:"https://v1.rspack.rs/plugins/rspack/esm-library-plugin",rel:"noopener noreferrer",target:"_blank",children:"EsmLibraryPlugin"}
1),", purpose-built for constructing clean and efficient ESM libraries:"]}),"\n",(0,n.jsxs)(s.ul,{children:["\n",(0,n.jsxs)(s.li,{children:[(0,n.jsx)(s.strong,{children:"Full control over the bundling process"})," â All modules are linked during compilation, eliminating reliance on Rspack's runtime."]}),"\n",(0,n.jsxs)(s.li,{children:[(0,n.jsx)(s.strong,{children:"Code-splitting support"})," â Code after splitting can be statically analyzed and is tree-shaking friendly."]}),"\n"]}),"\n",(0,n.jsx)(s.p,{children:"The image below compares the code splitting output before and after using this plugin â the left side shows the previous output, while the right side shows the cleaner output produced by EsmLibraryPlugin:"}),"\n",(0,n.jsx)(s.p,{children:(0,n.jsx)(s.img,{src:"https://assets.rspack.rs/rspack/assets/rspack-v1-6-esm-diff.png",alt:"Rspack 1.6 ESM output diff"})}),"\n",(0,n.jsx)(s.p,{children:"The EsmLibraryPlugin is now largely complete and is being integrated into Rslib to provide an out-of-the-box experience. You can also enable it manually with the following configuration:"}),"\n",(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(s.pre,{className:"shiki css-variables",style:{backgroundColor:"var(--shiki-background)",color:"var(--shiki-foreground)"},tabIndex:"0",title:"rspack.config.mjs",lang:"js",children:(0,n.jsxs)(s.code,{children:[(0,n.jsxs)(s.span,{className:"line",children:[(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-keyword)"},children:"import"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:" { rspack } "}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-keyword)"},children:"from"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-string-expression)"},children:" '@rspack/core'"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:";"})]}),"\n",(0,n.jsx)(s.span,{className:"line"}),"\n",(0,n.jsxs)(s.span,{className:"line",children:[(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-keyword)"},children:"export"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-keyword)"},children:" default"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:" {"})]}),"\n",(0,n.jsxs)(s.span,{className:"line",children:[(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:" plugins"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-keyword)"},children:":"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:" ["}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-keyword)"},children:"new"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-constant)"},children:" rspack"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-function)"},children:"."}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-constant)"},children:"experiments"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-function)"},children:".EsmLibraryPlugin"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:"()]"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-punctuation)"},children:","})]}),"\n",(0,n.jsxs)(s.span,{className:"line",children:[(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:" optimization"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-keyword)"},children:":"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:" {"})]}),"\n",(0,n.jsx)(s.span,{className:"line",children:(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-comment)"},children:" // Recommended to enable; otherwise, consumers must import runtime code from the entry."})}),"\n",(0,n.jsxs)(s.span,{className:"line",children:[(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:" runtimeChunk"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-keyword)"},children:":"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-constant)"},children:" true"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-punctuation)"},children:","})]}),"\n",(0,n.jsxs)(s.span,{className:"line",children:[(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:" }"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-punctuation)"},children:","})]}),"\n",(0,n.jsx)(s.span,{className:"line",children:(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:"};"})})]})})}),"\n",(0,n.jsxs)(s.p,{children:["In addition, we've introduced an ",(0,n.jsx)(s.code,{children:"preserveModules"})," option that preserves the original directory structure of your source files in the output:"]}),"\n",(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(s.pre,{className:"shiki css-variables",style:{backgroundColor:"var(--shiki-background)",color:"var(--shiki-foreground)"},tabIndex:"0",title:"rspack.config.mjs",lang:"js",children:(0,n.jsxs)(s.code,{children:[(0,n.jsxs)(s.span,{className:"line",children:[(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-keyword)"},children:"import"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:" path "}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-keyword)"},children:"from"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-string-expression)"},children:" 'node:path'"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:";"})]}),"\n",(0,n.jsx)(s.span,{className:"line"}),"\n",(0,n.jsxs)(s.span,{className:"line",children:[(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-keyword)"},children:"export"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-keyword)"},children:" default"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:" {"})]}),"\n",(0,n.jsxs)(s.span,{className:"line",children:[(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:" plugins"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-keyword)"},children:":"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:" ["})]}),"\n",(0,n.jsxs)(s.span,{className:"line",children:[(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-keyword)"},children:" new"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-constant)"},children:" rspack"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-function)"},children:"."}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-constant)"},children:"experiments"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-function)"},children:".EsmLibraryPlugin"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:"({"})]}),"\n",(0,n.jsxs)(s.span,{className:"line",children:[(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:" preserveModules"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-keyword)"},children:":"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-constant)"},children:" path"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-function)"},children:".resolve"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:"("}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-keyword)"},children:"import"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:"."}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-constant)"},children:"meta"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:".dirname"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-punctuation)"},children:","}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-string-expression)"},children:" './src'"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:")"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-punctuation)"},children:","})]}),"\n",(0,n.jsxs)(s.span,{className:"line",children:[(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:" })"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-punctuation)"},children:","})]}),"\n",(0,n.jsxs)(s.span,{className:"line",children:[(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:" ]"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-punctuation)"},children:","})]}),"\n",(0,n.jsx)(s.span,{className:"line",children:(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:"};"})})]})})}),"\n",(0,n.jsxs)(s.h3,{id:"optimized-barrels-by-default",children:[(0,n.jsx)(s.a,{className:"rp-header-anchor","aria-hidden":"true",href:"#optimized-barrels-by-default",children:"#"}),"Optimized barrels by default"]}),"\n",(0,n.jsxs)(s.p,{children:["In Rspack 1.5, we introduced the experimental ",(0,n.jsx)(s.a,{href:"/guide/advanced/lazy-barrel.html",children:"lazyBarrel"})," optimization feature, specifically designed to improve the build performance of barrel files. After a period of production environment practice and user feedback collection, we confirmed that the lazyBarrel feature has reached a stable state, so it is enabled by default in Rspack 1.6."]}),"\n",(0,n.jsx)(o.Pq,{type:"info",title:"Info",children:(0,n.jsx)(s.p,{children:"\nWhat are barrel files? Barrel files are files that are primarily used to re-export content from other modules, typically used to simplify import paths and provide a unified API entry point."})}),"\n",(0,n.jsxs)(s.h3,{id:"stabilized-layers-feature",children:[(0,n.jsx)(s.a,{className:"rp-header-anchor","aria-hidden":"true",href:"#stabilized-layers-feature",children:"#"}),"Stabilized layers feature"]}),"\n",(0,n.jsx)(s.p,{children:"Layer is a feature for organizing modules into different layers, which can be useful in advanced scenarios such as React Server Components. By assigning different layers to modules, you can gain finer control over their build behavior, for example:"}),"\n",(0,n.jsxs)(s.ul,{children:["\n",(0,n.jsx)(s.li,{children:"Compiling modules in different layers for different target environments"}),"\n",(0,n.jsx)(s.li,{children:"Outputting them to separate build directories"}),"\n"]}),"\n",(0,n.jsxs)(s.p,{children:["Starting from Rspack 1.6, the layer feature has become stable enough that the experimental flag ",(0,n.jsx)(s.a,{href:"/guide/advanced/layer.html",children:"experiments.layers"})," has been deprecated. You can now use the layer feature directly without the experimental flag."]}),"\n",(0,n.jsxs)(s.p,{children:["For more details and practical examples, check out our new ",(0,n.jsx)(s.a,{href:"/guide/advanced/layer.html",children:"Module layers guide"}),"."]}),"\n",(0,n.jsxs)(s.h3,{id:"preserve-jsx-syntax",children:[(0,n.jsx)(s.a,{className:"rp-header-anchor","aria-hidden":"true",href:"#preserve-jsx-syntax",children:"#"}),"Preserve JSX syntax"]}),"\n",(0,n.jsx)(s.p,{children:"Rspack now supports preserving JSX syntax in the build output. When this option is enabled, Rspack only parses JSX syntax without transforming it into JavaScript."}),"\n",(0,n.jsx)(s.p,{children:"This feature is especially useful when building libraries that rely on JSX. For example, when using Rslib to build a component library, you can choose to keep the JSX code as-is in the output, allowing the consumer to handle the final JSX transformation during usage."}),"\n",(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(s.pre,{className:"shiki css-variables",style:{backgroundColor:"var(--shiki-background)",color:"var(--shiki-foreground)"},tabIndex:"0",title:"rspack.config.mjs",lang:"js",children:(0,n.jsxs)(s.code,{children:[(0,n.jsxs)(s.span,{className:"line",children:[(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-keyword)"},children:"export"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-keyword)"},children:" default"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:" {"})]}),"\n",(0,n.jsxs)(s.span,{className:"line",children:[(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:" module"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-keyword)"},children:":"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:" {"})]}),"\n",(0,n.jsxs)(s.span,{className:"line",children:[(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:" parser"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-keyword)"},children:":"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:" {"})]}),"\n",(0,n.jsxs)(s.span,{className:"line",children:[(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:" javascript"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-keyword)"},children:":"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:" {"})]}),"\n",(0,n.jsxs)(s.span,{className:"line",children:[(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:" jsx"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-keyword)"},children:":"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-constant)"},children:" true"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-punctuation)"},children:","}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-comment)"},children:" // Enable JSX parsing"})]}),"\n",(0,n.jsxs)(s.span,{className:"line",children:[(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:" }"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-punctuation)"},children:","})]}),"\n",(0,n.jsxs)(s.span,{className:"line",children:[(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:" }"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-punctuation)"},children:","})]}),"\n",(0,n.jsxs)(s.span,{className:"line",children:[(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:" rules"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-keyword)"},children:":"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:" ["})]}),"\n",(0,n.jsx)(s.span,{className:"line",children:(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:" {"})}),"\n",(0,n.jsxs)(s.span,{className:"line",children:[(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:" test"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-keyword)"},children:":"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-string-expression)"},children:" /\\.jsx"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-keyword)"},children:"?$"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-string-expression)"},children:"/"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-punctuation)"},children:","})]}),"\n",(0,n.jsxs)(s.span,{className:"line",children:[(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:" use"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-keyword)"},children:":"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:" {"})]}),"\n",(0,n.jsxs)(s.span,{className:"line",children:[(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:" loader"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-keyword)"},children:":"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-string-expression)"},children:" 'builtin:swc-loader'"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-punctuation)"},children:","})]}),"\n",(0,n.jsxs)(s.span,{className:"line",children:[(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:" options"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-keyword)"},children:":"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:" {"})]}),"\n",(0,n.jsxs)(s.span,{className:"line",children:[(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:" jsc"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-keyword)"},children:":"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:" {"})]}),"\n",(0,n.jsxs)(s.span,{className:"line",children:[(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:" parser"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-keyword)"},children:":"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:" { jsx"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-keyword)"},children:":"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-constant)"},children:" true"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:" }"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-punctuation)"},children:","})]}),"\n",(0,n.jsxs)(s.span,{className:"line",children:[(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:" transform"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-keyword)"},children:":"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:" {"})]}),"\n",(0,n.jsx)(s.span,{className:"line",children:(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-comment)
1"},children:" // Preserve JSX syntax"})}),"\n",(0,n.jsxs)(s.span,{className:"line",children:[(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:" react"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-keyword)"},children:":"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:" { runtime"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-keyword)"},children:":"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-string-expression)"},children:" 'preserve'"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:" }"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-punctuation)"},children:","})]}),"\n",(0,n.jsxs)(s.span,{className:"line",children:[(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:" }"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-punctuation)"},children:","})]}),"\n",(0,n.jsxs)(s.span,{className:"line",children:[(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:" }"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-punctuation)"},children:","})]}),"\n",(0,n.jsxs)(s.span,{className:"line",children:[(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:" }"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-punctuation)"},children:","})]}),"\n",(0,n.jsxs)(s.span,{className:"line",children:[(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:" }"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-punctuation)"},children:","})]}),"\n",(0,n.jsxs)(s.span,{className:"line",children:[(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:" }"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-punctuation)"},children:","})]}),"\n",(0,n.jsxs)(s.span,{className:"line",children:[(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:" ]"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-punctuation)"},children:","})]}),"\n",(0,n.jsxs)(s.span,{className:"line",children:[(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:" }"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-punctuation)"},children:","})]}),"\n",(0,n.jsx)(s.span,{className:"line",children:(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:"};"})})]})})}),"\n",(0,n.jsxs)(s.h3,{id:"extract-source-map",children:[(0,n.jsx)(s.a,{className:"rp-header-anchor","aria-hidden":"true",href:"#extract-source-map",children:"#"}),"Extract source map"]}),"\n",(0,n.jsxs)(s.p,{children:["Rspack now supports extracting existing source map data from files (from their ",(0,n.jsx)(s.code,{children:"//# sourceMappingURL"})," comments) through ",(0,n.jsx)(s.a,{href:"/config/module-rules.html#rulesextractsourcemap",children:"rules[].extractSourceMap"}),". This feature is particularly useful for preserving source maps provided by third-party libraries, ensuring that debugging information remains accurate even when these libraries are bundled or transformed."]}),"\n",(0,n.jsxs)(s.p,{children:["This feature was introduced as a built-in alternative to ",(0,n.jsx)(s.a,{href:"https://github.com/webpack-contrib/source-map-loader",rel:"noopener noreferrer",target:"_blank",children:"source-map-loader"}),", providing better performance and tighter integration with the build process."]}),"\n",(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(s.pre,{className:"shiki css-variables",style:{backgroundColor:"var(--shiki-background)",color:"var(--shiki-foreground)"},tabIndex:"0",title:"rspack.config.mjs",lang:"js",children:(0,n.jsxs)(s.code,{children:[(0,n.jsxs)(s.span,{className:"line",children:[(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-keyword)"},children:"export"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-keyword)"},children:" default"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:" {"})]}),"\n",(0,n.jsxs)(s.span,{className:"line",children:[(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:" module"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-keyword)"},children:":"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:" {"})]}),"\n",(0,n.jsxs)(s.span,{className:"line",children:[(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:" rules"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-keyword)"},children:":"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:" ["})]}),"\n",(0,n.jsx)(s.span,{className:"line",children:(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:" {"})}),"\n",(0,n.jsxs)(s.span,{className:"line",children:[(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:" test"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-keyword)"},children:":"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-string-expression)"},children:" /\\.m"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-keyword)"},children:"?"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-string-expression)"},children:"js"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-keyword)"},children:"$"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-string-expression)"},children:"/"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-punctuation)"},children:","})]}),"\n",(0,n.jsxs)(s.span,{className:"line",children:[(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:" extractSourceMap"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-keyword)"},children:":"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-constant)"},children:" true"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-punctuation)"},children:","})]}),"\n",(0,n.jsxs)(s.span,{className:"line",children:[(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:" }"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-punctuation)"},children:","})]}),"\n",(0,n.jsxs)(s.span,{className:"line",children:[(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:" ]"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-punctuation)"},children:","})]}),"\n",(0,n.jsxs)(s.span,{className:"line",children:[(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:" }"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-punctuation)"},children:","})]}),"\n",(0,n.jsx)(s.span,{className:"line",children:(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:"};"})})]})})}),"\n",(0,n.jsxs)(s.h3,{id:"performance-improvements",children:[(0,n.jsx)(s.a,{className:"rp-header-anchor","aria-hidden":"true",href:"#performance-improvements",children:"#"}),"Performance improvements"]}),"\n",(0,n.jsx)(s.p,{children:"Rspack 1.6 introduces several performance optimizations. Compared with Rspack 1.5.0, you can expect the following improvements:"}),"\n",(0,n.jsxs)(s.ul,{children:["\n",(0,n.jsxs)(s.li,{children:["CLI startup is about ",(0,n.jsx)(s.strong,{children:"50 ms faster"})]}),"\n",(0,n.jsxs)(s.li,{children:["Building 10000 React components is ",(0,n.jsx)(s.strong,{children:"11% faster"})]}),"\n",(0,n.jsxs)(s.li,{children:["Building multiple UI component libraries is ",(0,n.jsx)(s.strong,{children:"31% faster"})," (thanks to the newly enabled barrel-file optimization by default)"]}),"\n"]}),"\n",(0,n.jsxs)(s.blockquote,{children:["\n",(0,n.jsxs)(s.p,{children:["Data source: ",(0,n.jsx)(s.a,{href:"https://github.com/rstackjs/build-tools-performance",rel:"noopener noreferrer",target:"_blank",children:"Rspack benchmark"})]}),"\n"]}),"\n",(0,n.jsxs)(s.h2,{id:"rstack-progress",children:[(0,n.jsx)(s.a,{className:"rp-header-anchor","aria-hidden":"true",href:"#rstack-progress",children:"#"}),"Rstack progress"]}),"\n",(0,n.jsxs)(s.p,{children:[(0,n.jsx)(s.a,{href:"/guide/start/ecosystem.html#rstack",children:"Rstack"})," is a unified JavaScript toolchain centered around Rspack, featuring excellent performance and consistent ar
1chitecture."]}),"\n",(0,n.jsxs)(s.h3,{id:"rsbuild-16",children:[(0,n.jsx)(s.a,{className:"rp-header-anchor","aria-hidden":"true",href:"#rsbuild-16",children:"#"}),"Rsbuild 1.6"]}),"\n",(0,n.jsxs)(s.h4,{id:"forward-browser-logs",children:[(0,n.jsx)(s.a,{className:"rp-header-anchor","aria-hidden":"true",href:"#forward-browser-logs",children:"#"}),"Forward browser logs"]}),"\n",(0,n.jsx)(s.p,{children:"Rsbuild now automatically forwards error logs from the browser to the terminal, helping you conveniently view runtime errors during development. This also enables Coding Agents to obtain more complete context from terminal logs, allowing them to better analyze and locate errors."}),"\n",(0,n.jsx)(s.p,{children:(0,n.jsx)(s.img,{src:"https://assets.rspack.rs/rspack/assets/rspack-v1-6-error-forward.png",alt:"rsbuild-error-forward"})}),"\n",(0,n.jsxs)(s.p,{children:["If you don't need this feature, you can disable it by setting ",(0,n.jsx)(s.a,{href:"https://rsbuild.rs/config/dev/browser-logs",rel:"noopener noreferrer",target:"_blank",children:"dev.browserLogs"})," to false:"]}),"\n",(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(s.pre,{className:"shiki css-variables",style:{backgroundColor:"var(--shiki-background)",color:"var(--shiki-foreground)"},tabIndex:"0",title:"rsbuild.config.ts",lang:"js",children:(0,n.jsxs)(s.code,{children:[(0,n.jsxs)(s.span,{className:"line",children:[(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-keyword)"},children:"export"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-keyword)"},children:" default"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:" {"})]}),"\n",(0,n.jsxs)(s.span,{className:"line",children:[(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:" dev"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-keyword)"},children:":"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:" {"})]}),"\n",(0,n.jsxs)(s.span,{className:"line",children:[(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:" browserLogs"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-keyword)"},children:":"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-constant)"},children:" false"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-punctuation)"},children:","})]}),"\n",(0,n.jsxs)(s.span,{className:"line",children:[(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:" }"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-punctuation)"},children:","})]}),"\n",(0,n.jsx)(s.span,{className:"line",children:(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:"};"})})]})})}),"\n",(0,n.jsxs)(s.h4,{id:"building-esm-applications",children:[(0,n.jsx)(s.a,{className:"rp-header-anchor","aria-hidden":"true",href:"#building-esm-applications",children:"#"}),"Building ESM applications"]}),"\n",(0,n.jsxs)(s.p,{children:["Rsbuild now supports building ES Modules format output for Web applications, simply enable ",(0,n.jsx)(s.a,{href:"https://rsbuild.rs/config/output/module",rel:"noopener noreferrer",target:"_blank",children:"output.module: true"}),":"]}),"\n",(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(s.pre,{className:"shiki css-variables",style:{backgroundColor:"var(--shiki-background)",color:"var(--shiki-foreground)"},tabIndex:"0",title:"rsbuild.config.ts",lang:"ts",children:(0,n.jsxs)(s.code,{children:[(0,n.jsxs)(s.span,{className:"line",children:[(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-keyword)"},children:"export"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-keyword)"},children:" default"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:" {"})]}),"\n",(0,n.jsxs)(s.span,{className:"line",children:[(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:" output"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-keyword)"},children:":"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:" {"})]}),"\n",(0,n.jsxs)(s.span,{className:"line",children:[(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:" module"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-keyword)"},children:":"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-constant)"},children:" true"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-punctuation)"},children:","})]}),"\n",(0,n.jsxs)(s.span,{className:"line",children:[(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:" }"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-punctuation)"},children:","})]}),"\n",(0,n.jsx)(s.span,{className:"line",children:(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:"};"})})]})})}),"\n",(0,n.jsxs)(s.p,{children:["Once enabled, Rsbuild will no longer generate IIFE format scripts by default, but will output standard ESM format and automatically set the generated ",(0,n.jsx)(s.code,{children:"<script>"})," tags to ",(0,n.jsx)(s.code,{children:'type="module"'}),"."]}),"\n",(0,n.jsxs)(s.h4,{id:"faster-configuration-loading",children:[(0,n.jsx)(s.a,{className:"rp-header-anchor","aria-hidden":"true",href:"#faster-configuration-loading",children:"#"}),"Faster configuration loading"]}),"\n",(0,n.jsxs)(s.p,{children:["Since Node.js 22 already natively supports TypeScript, Rsbuild now defaults to using Node.js's native loader to parse configuration files; if loading fails, it will automatically fall back to ",(0,n.jsx)(s.a,{href:"https://github.com/unjs/jiti",rel:"noopener noreferrer",target:"_blank",children:"Jiti"}),". When using Node.js 22 and above, this mechanism ensures that module resolution behavior remains consistent with Node.js native behavior while providing better loading performance."]}),"\n",(0,n.jsx)(s.p,{children:"You can also manually specify the loading method through the Rsbuild CLI's --config-loader option:"}),"\n",(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(s.pre,{className:"shiki css-variables",style:{backgroundColor:"var(--shiki-background)",color:"var(--shiki-foreground)"},tabIndex:"0",lang:"bash",children:(0,n.jsxs)(s.code,{children:[(0,n.jsx)(s.span,{className:"line",children:(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-comment)"},children:"# Force use of native loading"})}),"\n",(0,n.jsxs)(s.span,{className:"line",children:[(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-function)"},children:"rsbuild"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-string)"},children:" build"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-string)"},children:" --config-loader"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-string)"},children:" native"})]}),"\n",(0,n.jsx)(s.span,{className:"line"}),"\n",(0,n.jsx)(s.span,{className:"line",children:(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-comment)"},children:"# Force use of jiti loading"})}),"\n",(0,n.jsxs)(s.span,{className:"line",children:[(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-function)"},children:"rsbuild"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-string)"},children:" build"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-string)"},children:" --config-loader"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-string)"},children:" jiti"})]})]})})}),"\n",(0,n.jsxs)(s.h3,{id:"rspress-v2-beta",children:[(0,n.jsx)(s.a,{className:"rp-header-anchor","aria-hidden":"true",href:"#rspress-v2-beta",children:"#"}),"Rspress v2 beta"]}),"\n",(0,n.jsxs)(s.h4,{id:"new-theme-preview",children:[(0,n.jsx)(s.a,{className:"rp-header-anchor","aria-hidden":"true",href:"#new-theme-preview",children:"#"}),"New theme preview"]}),"\n",(0,n.jsx)(s.p,{children:"Rspress's new theme has entered preview phase and is now live on the v2 website. ð"}),"\n",(0,n.jsx)(s.p,{children:"The new theme has been comprehensively upgraded in design, bringing a better documentation reading experience. It also exposes more theme APIs and CSS class names, making it easier for developers to customize the UI."}),"\n",(0,n.jsxs)(s.blockquote,{children:["\n",(0,n.jsxs)(s.p,{children:["ð Visit the ",(0,n.jsx)(s.a,{href:"https://v2.rspress.rs/",rel:"noopener noreferrer",target:"_blank",children:"Rspress v2 website"})," to try it out."]}),"\n"]}),"\n",(0,n.jsx)(s.p,{children:(0,n.jsx)(s.img,{src:"https://assets.rspack.rs/rspack/assets/rspack-v1-6-rspress.gif",alt:"rspress-v2-theme"})}),"\n",(0,n.jsxs)(s.h4,{id:"sub-page-switching",children:[(0,n.jsx)(s.a,{className:"rp-header-anchor","aria-hidden":"true",href:"#sub-page-switching",children:"#"}),"Sub-page switching"]}),"\n",(0,n.jsxs)(s.p,{children:["Rspress v2 introduces the ",(0,n.jsx)(s.a,{href:"https://v2.rspress.rs/ui/components/page-tabs",rel:"noopener noreferrer",target:"_blank",children:"PageTabs"})," component, allowing you to create multiple sub-tabs within a single page. This helps naturally split long content into well-structured subpages."]}),"\n",(0,n.jsx)(s.p,{children:(0,n.jsx)(s.img,{src:"https://assets.rspack.rs/rspack/assets/rspack-v1-6-page-tabs.png",alt:"Rspress sub-page switching"})}),"\n",(0,n.jsxs)(s.h3,{id:"rslib-016",children:[(0,n.jsx)(s.a,{className:"rp-header-anchor","aria-hidden":"true",href:"#rslib-016",children:"#"}),"Rslib 0.16"]}),"\n",(0,n.jsxs)(s.h4,{id:"faster-type-generation",children:[(0,n.jsx)(s.a,{className:"rp-header-anchor","aria-hidden":"true",href:"#faster-type-generation",children:"#"}),"Faster type generation"]}),"\n",(0,n.jsxs)(s.p,{children:["Rslib now supports generating type declaration files based on ",(0,n.jsx)(s.a,{href:"https://github.com/microsoft/typescript-go",rel:"noopener noreferrer",target:"_blank",children:"typescript-go"}),". By simply enabling ",(0,n.jsx)(s.a,{href:"https://rslib.rs/config/lib/dts#dtstsgo",rel:"noopener noreferrer",target:"_blank",children:"dts.tsgo"}),", you can boost type checking and declaration generation performance by around ",(0,n.jsx)(s.strong,{children:"300%"}),", with even greater benefits in large projects."]}),"\n",(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(s.pre,{className:"shiki css-variables",style:{backgroundColor:"var(--shiki-background)",color:"var(--shiki-foreground)"},tabIndex:"0",title:"rslib.config.ts",lang:"ts",children:(0,n.jsxs)(s.code,{children:[(0,n.jsxs)(s.span,{className:"line",children:[(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-keyword)"},children:"export"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-keyword)"},children:" default"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:" {"})]}),"\n",(0,n.jsxs)(s.span,{className:"line",children:[(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:" lib"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-keyword)"},children:":"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:" ["})]}),"\n",(0,n.jsx)(s.span,{className:"line",children:(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:" {"})}),"\n",(0,n.jsxs)(s.span,{className:"line",children:[(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:" dts"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-keyword)"},children:":"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:" { tsgo"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-keyword)"},children:":"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-constant)"},children:" true"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:" }"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-punctuation)"},children:","})]}),"\n",(0,n.jsxs)(s.span,{className:"line",children:[(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:" }"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-punctuation)"},children:","})]}),"\n",(0,n.jsxs)(s.span,{className:"line",children:[(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:" ]"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-punctuation)"},children:","})]}),"\n",(0,n.jsx)(s.span,{className:"line",children:(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:"};"})})]})})}),"\n",(0,n.jsxs)(s.h4,{id:"preserve-jsx-syntax-1",children:[(0,n.jsx)(s.a,{className:"rp-header-anchor","aria-hidden":"true",href:"#preserve-jsx-syntax-1",children:"#"}),"Preserve JSX syntax"]}),"\n",(0,n.jsxs)(s.p,{children:["Rslib now supports preserving original JSX in build output, simply set runtime to ",(0,n.jsx)(s.a,{href:"https://rsbuild.rs/plugins/list/plugin-react#preserve",rel:"noopener noreferrer",target:"_blank",children:(0,n.jsx)(s.code,{children:"'preserve'"})}),". In this mode, JSX syntax will be preserved as-is without any transformation, making it convenient for subsequent processing by other bundling tools."]}),"\n",(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(s.pre,{className:"shiki css-variables",style:{backgroundColor:"var(--shiki-background)",color:"var(--shiki-foreground)"},tabIndex:"0",title:"rslib.config.ts",lang:"ts",children:(0,n.jsxs)(s.code,{children:[(0,n.jsxs)(s.span,{className:"line",children:[(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-keyword)"},children:"import"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:" { pluginReact } "}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-keyword)"},children:"from"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-string-expression)"},children:" '@rsbuild/plugin-react'"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:";"})]}),"\n",(0,n.jsx)(s.span,{className:"line"}),"\n",(0,n.jsxs)(s.span,{className:"line",children:[(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-keyword)"},children:"export"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-keyword)"},children:" default"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:" {"})]}),"\n",(0,n.jsxs)(s.span,{className:"line",children:[(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:" lib"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-keyword)"},children:":"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:" ["})]}),"\n",(0,n.jsx)(s.span,{className:"line",children:(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:" {"})}),"\n",(0,n.jsxs)(s.span,{className:"line",children:[(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:" bundle"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-keyword)"},children:":"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-constant)"},children:" false"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-punctuation)"},children:","})]}),"\n",(0,n.jsxs)(s.span,{className:"line",children:[(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:" format"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-keyword)"},children:":"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-string-expression)"},children:" 'esm'"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-punctuation)"},children:","})]}),"\n",(0,n.jsxs)(s.span,{className:"line",children:[(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:" }"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-punctuation)"},children:","})]}),"\n",(0,n.jsxs)(s.span,{className:"line",children:[(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:" ]"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-punctuation)"},children:","})]}),"\n",(0,n.jsxs)(s.span,{className:"line",children:[(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:" plugins"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-keyword)"},children:":"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:" ["})]}),"\n",(0,n.jsxs)(s.span,{className:"line",children:[(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-function)"},children:" pluginReact"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:"({"})]}),"\n",(0,n.jsxs)(s.span,{className:"line",children:[(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:" swcReactOptions"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-keyword)"},children:":"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:" {"})]}),"\n",(0,n.jsxs)(s.span,{className:"line",children:[(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:" runtime"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-keyword)"},children:":"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-string-expression)"},children:" 'preserve'"}),(0,n.jsx)(
1s.span,{style:{color:"var(--shiki-token-punctuation)"},children:","})]}),"\n",(0,n.jsxs)(s.span,{className:"line",children:[(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:" }"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-punctuation)"},children:","})]}),"\n",(0,n.jsxs)(s.span,{className:"line",children:[(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:" })"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-punctuation)"},children:","})]}),"\n",(0,n.jsxs)(s.span,{className:"line",children:[(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:" ]"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-punctuation)"},children:","})]}),"\n",(0,n.jsx)(s.span,{className:"line",children:(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:"};"})})]})})}),"\n",(0,n.jsxs)(s.h4,{id:"more-cli-options",children:[(0,n.jsx)(s.a,{className:"rp-header-anchor","aria-hidden":"true",href:"#more-cli-options",children:"#"}),"More CLI options"]}),"\n",(0,n.jsxs)(s.p,{children:["Rslib supports additional ",(0,n.jsx)(s.a,{href:"https://rslib.rs/guide/basic/cli#rslib-build",rel:"noopener noreferrer",target:"_blank",children:"CLI options"})," in the build command, which take precedence over configuration files."]}),"\n",(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(s.pre,{className:"shiki css-variables",style:{backgroundColor:"var(--shiki-background)",color:"var(--shiki-foreground)"},tabIndex:"0",title:"package.json",lang:"json",children:(0,n.jsxs)(s.code,{children:[(0,n.jsx)(s.span,{className:"line",children:(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:"{"})}),"\n",(0,n.jsxs)(s.span,{className:"line",children:[(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-keyword)"},children:' "scripts"'}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-punctuation)"},children:":"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:" {"})]}),"\n",(0,n.jsxs)(s.span,{className:"line",children:[(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-keyword)"},children:' "build"'}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-punctuation)"},children:":"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-string-expression)"},children:' "rslib build --entry index.ts --minify --tsconfig tsconfig.build.json"'})]}),"\n",(0,n.jsx)(s.span,{className:"line",children:(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:" }"})}),"\n",(0,n.jsx)(s.span,{className:"line",children:(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:"}"})})]})})}),"\n",(0,n.jsxs)(s.p,{children:["This also allows you to use Rslib without a configuration file, and the CLI will automatically use a default configuration containing only a single ",(0,n.jsx)(s.a,{href:"https://rslib.rs/config/lib/",rel:"noopener noreferrer",target:"_blank",children:"lib"})," and complete the build based on command line parameters."]}),"\n",(0,n.jsxs)(s.h3,{id:"rstest-06",children:[(0,n.jsx)(s.a,{className:"rp-header-anchor","aria-hidden":"true",href:"#rstest-06",children:"#"}),"Rstest 0.6"]}),"\n",(0,n.jsxs)(s.h4,{id:"vs-code-extension",children:[(0,n.jsx)(s.a,{className:"rp-header-anchor","aria-hidden":"true",href:"#vs-code-extension",children:"#"}),"VS Code extension"]}),"\n",(0,n.jsxs)(s.p,{children:["The ",(0,n.jsx)(s.a,{href:"https://marketplace.visualstudio.com/items?itemName=rstack.rstest",rel:"noopener noreferrer",target:"_blank",children:"Rstest VS Code Extension"})," is now available. It allows you to discover, run, and debug tests directly within the editor, helping you efficiently manage test cases and quickly review test results."]}),"\n",(0,n.jsx)(s.p,{children:(0,n.jsx)(s.img,{src:"https://assets.rspack.rs/rspack/assets/rspack-v1-6-rstest-vscode-ext.gif",alt:"rstest-vscode-extension"})}),"\n",(0,n.jsxs)(s.h4,{id:"coverage-support",children:[(0,n.jsx)(s.a,{className:"rp-header-anchor","aria-hidden":"true",href:"#coverage-support",children:"#"}),"Coverage support"]}),"\n",(0,n.jsxs)(s.p,{children:["Rstest now supports collecting code coverage using Istanbul and generating detailed coverage reports. For more information, see ",(0,n.jsx)(s.a,{href:"https://rstest.rs/config/test/coverage",rel:"noopener noreferrer",target:"_blank",children:"Rstest â Coverage"}),"."]}),"\n",(0,n.jsx)(s.p,{children:(0,n.jsx)(s.img,{src:"https://assets.rspack.rs/rspack/assets/rspack-v1-6-rstest-cov.png",alt:"rstest-coverage"})}),"\n",(0,n.jsxs)(s.h3,{id:"rsdoctor-13",children:[(0,n.jsx)(s.a,{className:"rp-header-anchor","aria-hidden":"true",href:"#rsdoctor-13",children:"#"}),"Rsdoctor 1.3"]}),"\n",(0,n.jsxs)(s.h4,{id:"rsdoctor-github-actions",children:[(0,n.jsx)(s.a,{className:"rp-header-anchor","aria-hidden":"true",href:"#rsdoctor-github-actions",children:"#"}),"Rsdoctor GitHub Actions"]}),"\n",(0,n.jsxs)(s.p,{children:["Rsdoctor now provides a ",(0,n.jsx)(s.a,{href:"https://github.com/web-infra-dev/rsdoctor-action",rel:"noopener noreferrer",target:"_blank",children:"GitHub bundle diff action"}),", which automatically detects and compares bundle size changes during the CI phase. This helps teams identify and prevent bundle size regressions early."]}),"\n",(0,n.jsx)(s.p,{children:(0,n.jsx)(s.img,{src:"https://assets.rspack.rs/rspack/assets/rspack-v1-6-bundle-diff.png",alt:"Rsdoctor GitHub Actions"})}),"\n",(0,n.jsxs)(s.h4,{id:"all-in-one-json-report",children:[(0,n.jsx)(s.a,{className:"rp-header-anchor","aria-hidden":"true",href:"#all-in-one-json-report",children:"#"}),"All-in-one JSON report"]}),"\n",(0,n.jsxs)(s.p,{children:["Rsdoctor now supports exporting a ",(0,n.jsx)(s.a,{href:"https://rsdoctor.rs/config/options/output#mode-brief",rel:"noopener noreferrer",target:"_blank",children:"all-in-one JSON report file"})," in Brief mode. This file can be easily stored, shared, or used for further data analysis. In addition, weâve introduced a new ",(0,n.jsx)(s.a,{href:"https://rsdoctor.rs/guide/start/playground",rel:"noopener noreferrer",target:"_blank",children:"Playground page"}),", where developers can upload the JSON report to reopen and visually explore the analysis results."]}),"\n",(0,n.jsxs)(s.h2,{id:"ecosystem",children:[(0,n.jsx)(s.a,{className:"rp-header-anchor","aria-hidden":"true",href:"#ecosystem",children:"#"}),"Ecosystem"]}),"\n",(0,n.jsxs)(s.h3,{id:"next-rspack",children:[(0,n.jsx)(s.a,{className:"rp-header-anchor","aria-hidden":"true",href:"#next-rspack",children:"#"}),"next-rspack"]}),"\n",(0,n.jsxs)(s.p,{children:["In Next.js 16, next-rspack has integrated Rspack's ",(0,n.jsx)(s.a,{href:"https://github.com/rstackjs/rspack-binding-template",rel:"noopener noreferrer",target:"_blank",children:"custom Rust binding solution"}),", delivering significant performance gains:"]}),"\n",(0,n.jsxs)(s.ul,{children:["\n",(0,n.jsx)(s.li,{children:"24% faster build performance"}),"\n",(0,n.jsx)(s.li,{children:"10% faster dev performance"}),"\n"]}),"\n",(0,n.jsxs)(s.p,{children:["In this customized Rspack Rust binding, the ",(0,n.jsx)(s.code,{children:"externals"})," logic from Next.js has been moved to the Rust side, greatly reducing communication overhead between JavaScript and Rust."]}),"\n",(0,n.jsxs)(s.table,{children:[(0,n.jsx)(s.thead,{children:(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.th,{children:"Tool"}),(0,n.jsx)(s.th,{children:"Build time (no cache)"}),(0,n.jsx)(s.th,{children:"Dev time (no cache)"})]})}),(0,n.jsxs)(s.tbody,{children:[(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{children:"Rspack ([email protected])"}),(0,n.jsx)(s.td,{children:"3.8s"}),(0,n.jsx)(s.td,{children:"1.7s"})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{children:"Rspack ([email protected])"}),(0,n.jsx)(s.td,{children:"5.0s"}),(0,n.jsx)(s.td,{children:"1.9s"})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{children:"webpack"}),(0,n.jsx)(s.td,{children:"14.0s"}),(0,n.jsx)(s.td,{children:"7.8s"})]})]})]}),"\n",(0,n.jsxs)(s.p,{children:["The benchmark is based on the ",(0,n.jsx)(s.a,{href:"https://github.com/SyMind/chakra-ui-docs/tree/next-rspack",rel:"noopener noreferrer",target:"_blank",children:"chakra-ui-docs"})," repository. Full performance data is available here: ",(0,n.jsx)(s.a,{href:"https://github.com/SyMind/chakra-ui-docs/blob/next-rspack/PERF.md",rel:"noopener noreferrer",target:"_blank",children:"PERF.md"}),"."]}),"\n",(0,n.jsxs)(s.h2,{id:"upgrade-guide",children:[(0,n.jsx)(s.a,{className:"rp-header-anchor","aria-hidden":"true",href:"#upgrade-guide",children:"#"}),"Upgrade guide"]}),"\n",(0,n.jsxs)(s.h3,{id:"upgrade-swc-plugins",children:[(0,n.jsx)(s.a,{className:"rp-header-anchor","aria-hidden":"true",href:"#upgrade-swc-plugins",children:"#"}),"Upgrade SWC plugins"]}),"\n",(0,n.jsxs)(s.p,{children:["If your project uses SWC Wasm plugins (such as ",(0,n.jsx)(s.code,{children:"@swc/plugin-emotion"}),"), you need to upgrade the plugins to a version compatible with ",(0,n.jsx)(s.code,{children:"swc_core@46"}),", otherwise it may cause build errors due to version incompatibility."]}),"\n",(0,n.jsxs)(s.blockquote,{children:["\n",(0,n.jsxs)(s.p,{children:["For more details, see ",(0,n.jsx)(s.a,{href:"/errors/swc-plugin-version.html",children:"FAQ - SWC plugin version mismatch"}),"."]}),"\n"]}),"\n",(0,n.jsxs)(s.h3,{id:"remove-experimentslayer",children:[(0,n.jsx)(s.a,{className:"rp-header-anchor","aria-hidden":"true",href:"#remove-experimentslayer",children:"#"}),"Remove ",(0,n.jsx)(s.code,{children:"experiments.layer"})]}),"\n",(0,n.jsxs)(s.p,{children:[(0,n.jsx)(s.code,{children:"experiments.layer"})," option has been deprecated, you can remove it directly:"]}),"\n",(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(s.pre,{className:"shiki css-variables",style:{backgroundColor:"var(--shiki-background)",color:"var(--shiki-foreground)"},tabIndex:"0",title:"rspack.config.mjs",lang:"diff",children:(0,n.jsxs)(s.code,{children:[(0,n.jsx)(s.span,{className:"line",children:(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:"export default {"})}),"\n",(0,n.jsx)(s.span,{className:"line",children:(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-deleted)"},children:"- experiments: {"})}),"\n",(0,n.jsx)(s.span,{className:"line",children:(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-deleted)"},children:"- layer: true,"})}),"\n",(0,n.jsx)(s.span,{className:"line",children:(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-deleted)"},children:"- },"})}),"\n",(0,n.jsx)(s.span,{className:"line",children:(0,n.jsx)(s.span,{style:{color:"var(--shiki-foreground)"},children:"};"})})]})})})]})}function t(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{wrapper:s}={...(0,i.R)(),...e.components};return s?(0,n.jsx)(s,{...e,children:(0,n.jsx)(a,{...e})}):a(e)}t.__RSPRESS_PAGE_META={},t.__RSPRESS_PAGE_META["en%2Fblog%2Fannouncing-1-6.mdx"]={toc:[{id:"new-features",text:"New features",depth:2},{id:"enhanced-tree-shaking",text:"Enhanced tree shaking",depth:3},{id:"support-for-import-defer",text:"Support for import defer",depth:3},{id:"improved-esm-output",text:"Improved ESM output",depth:3},{id:"optimized-barrels-by-default",text:"Optimized barrels by default",depth:3},{id:"stabilized-layers-feature",text:"Stabilized layers feature",depth:3},{id:"preserve-jsx-syntax",text:"Preserve JSX syntax",depth:3},{id:"extract-source-map",text:"Extract source map",depth:3},{id:"performance-improvements",text:"Performance improvements",depth:3},{id:"rstack-progress",text:"Rstack progress",depth:2},{id:"rsbuild-16",text:"Rsbuild 1.6",depth:3},{id:"forward-browser-logs",text:"Forward browser logs",depth:4},{id:"building-esm-applications",text:"Building ESM applications",depth:4},{id:"faster-configuration-loading",text:"Faster configuration loading",depth:4},{id:"rspress-v2-beta",text:"Rspress v2 beta",depth:3},{id:"new-theme-preview",text:"New theme preview",depth:4},{id:"sub-page-switching",text:"Sub-page switching",depth:4},{id:"rslib-016",text:"Rslib 0.16",depth:3},{id:"faster-type-generation",text:"Faster type generation",depth:4},{id:"preserve-jsx-syntax-1",text:"Preserve JSX syntax",depth:4},{id:"more-cli-options",text:"More CLI options",depth:4},{id:"rstest-06",text:"Rstest 0.6",depth:3},{id:"vs-code-extension",text:"VS Code extension",depth:4},{id:"coverage-support",text:"Coverage support",depth:4},{id:"rsdoctor-13",text:"Rsdoctor 1.3",depth:3},{id:"rsdoctor-github-actions",text:"Rsdoctor GitHub Actions",depth:4},{id:"all-in-one-json-report",text:"All-in-one JSON report",depth:4},{id:"ecosystem",text:"Ecosystem",depth:2},{id:"next-rspack",text:"next-rspack",depth:3},{id:"upgrade-guide",text:"Upgrade guide",depth:2},{id:"upgrade-swc-plugins",text:"Upgrade SWC plugins",depth:3},{id:"remove-experimentslayer",text:"Remove `experiments.layer`",depth:3}],title:"Announcing Rspack 1.6",headingTitle:"Announcing Rspack 1.6",frontmatter:{description:"Rspack 1.6 has been released with better ESM output, enhanced tree shaking, support for the import defer syntax, stabilized layers feature, and default barrel file optimization.",date:"2025-10-30T16:00:00.000Z",sidebar:!1,authors:[{name:"Rspack Team",avatar:"https://assets.rspack.rs/rspack/rspack-logo-with-background.png",title:"@rspack_dev",x:"https://x.com/rspack_dev"}]}},r.d(s,{default:()=>t})},No(e,s,r){r("oM");var n=r("i"),i=r("iO"),o=r("O"),l=r("CA");let a=e=>null!==e&&"object"==typeof e&&"string"==typeof e.name&&"string"==typeof e.avatar,t=e=>{var s;if(!e.github)return e;let r=e.github.startsWith("http")?e.github:`https://github.com/${e.github}`;return{...e,github:r,title:null!=(s=e.title)?s:`@${e.github}`}};function c({className:e}){var s;let{page:r}=(0,i.e)(),d=null!=(s=r.frontmatter)?s:{},h=(0,o.useMemo)(()=>Array.isArray(d.authors)?d.authors.filter(a).map(t):Array.isArray(d.author)?d.author.filter(a).map(t):a(d.author)?[t(d.author)]:[],[d]);return(0,n.jsx)(l.h,{authors:h,className:((...e)=>
1e.filter(Boolean).join(" "))("root-YZxMH8",e)})}r.d(s,{d:()=>c})},CA(e,s,r){r("Lb");var n=r("i");let i=(...e)=>e.filter(Boolean).join(" "),o=e=>{var s,r;return`${e.name}-${null!=(s=null!=(r=e.github)?r:e.x)?s:e.avatar}`},l=()=>(0,n.jsx)("svg",{viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:(0,n.jsx)("path",{fill:"currentColor",d:"M12 .297c-6.63 0-12 5.373-12 12c0 5.303 3.438 9.8 8.205 11.385c.6.113.82-.258.82-.577c0-.285-.01-1.04-.015-2.04c-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729c1.205.084 1.838 1.236 1.838 1.236c1.07 1.835 2.809 1.305 3.495.998c.108-.776.417-1.305.76-1.605c-2.665-.3-5.466-1.332-5.466-5.93c0-1.31.465-2.38 1.235-3.22c-.135-.303-.54-1.523.105-3.176c0 0 1.005-.322 3.3 1.23c.96-.267 1.98-.399 3-.405c1.02.006 2.04.138 3 .405c2.28-1.552 3.285-1.23 3.285-1.23c.645 1.653.24 2.873.12 3.176c.765.84 1.23 1.91 1.23 3.22c0 4.61-2.805 5.625-5.475 5.92c.42.36.81 1.096.81 2.22c0 1.606-.015 2.896-.015 3.286c0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"})}),a=()=>(0,n.jsx)("svg",{viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:(0,n.jsx)("path",{fill:"currentColor",d:"M18.901 1.153h3.68l-8.04 9.19L24 22.846h-7.406l-5.8-7.584l-6.638 7.584H.474l8.6-9.83L0 1.154h7.594l5.243 6.932ZM17.61 20.644h2.039L6.486 3.24H4.298Z"})});function t({author:e,className:s}){let{avatar:r,name:o,title:c}=e,d=(({github:e,links:s,name:r,x:i})=>[...e?[{href:e,label:`${r}'s GitHub`,icon:(0,n.jsx)(l,{})}]:[],...i?[{href:i,label:`${r}'s X profile`,icon:(0,n.jsx)(a,{})}]:[],...null!=s?s:[]])(e);return(0,n.jsxs)("div",{className:i("root-Sr_5x3",s),children:[(0,n.jsx)("img",{src:r,alt:o,className:"avatar-XCZJhu",loading:"lazy",decoding:"async"}),(0,n.jsxs)("div",{className:"content-BhgM4E",children:[(0,n.jsxs)("div",{className:"nameRow-U9Q3S8",children:[(0,n.jsx)("div",{className:"name-k91bx6",children:o}),d.length>0?(0,n.jsx)("div",{className:"links-jK83Yg",children:d.map(e=>(0,n.jsx)("a",{href:e.href,target:"_blank",rel:"noopener noreferrer",className:"link-yDHY4Y","aria-label":e.label,children:e.icon},`${e.label}-${e.href}`))}):null]}),c?(0,n.jsx)("div",{className:"title-MMKZdf",children:c}):null]})]})}function c({authors:e,className:s,compact:r=!1}){if(0===e.length)return null;if(!r)return(0,n.jsx)("div",{className:i("group-n_jNI7",s),children:e.map(e=>(0,n.jsx)(t,{author:e,className:"groupItem-m5U5nn"},o(e)))});let l=e.slice(0,8),a=e.length-l.length,d=e.map(e=>e.name).join(", "),h=e.length<=2;return(0,n.jsxs)("div",{className:i("compactGroup-Ij3Cuk",s),title:d,children:[(0,n.jsxs)("div",{className:"compactAvatars-K_PsP6","aria-hidden":"true",children:[l.map(e=>(0,n.jsx)("img",{src:e.avatar,alt:"",className:"compactAvatar-VpXzKi",loading:"lazy",decoding:"async"},o(e))),a>0?(0,n.jsxs)("span",{className:"compactOverflow-PYOrvO",children:["+",a]}):null]}),h?(0,n.jsx)("div",{className:"compactNames-yJrKbP",children:d}):null]})}r.d(s,{h:()=>c})}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.