1"use strict";(self.rspackChunkrsbuild_website=self.rspackChunkrsbuild_website||[]).push([["c2"],{sN(s,e,r){r.r(e);var n=r("E"),i=r("H");function o(s){let e={a:"a",blockquote:"blockquote",code:"code",h1:"h1",h2:"h2",li:"li",p:"p",pre:"pre",span:"span",strong:"strong",ul:"ul",...(0,i.R)(),...s.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(e.h1,{id:"sourceexclude",children:[(0,n.jsx)(e.a,{className:"rp-header-anchor","aria-hidden":"true",href:"#sourceexclude",children:"#"}),"source.exclude"]}),"\n",(0,n.jsxs)(e.ul,{children:["\n",(0,n.jsxs)(e.li,{children:[(0,n.jsx)(e.strong,{children:"ç±»åï¼"})," ",(0,n.jsx)(e.a,{href:"https://rspack.rs/zh/config/module-rules#condition",rel:"noopener noreferrer",target:"_blank",children:"Rspack.RuleSetCondition"}),(0,n.jsx)(e.code,{children:"[]"})]}),"\n",(0,n.jsxs)(e.li,{children:[(0,n.jsx)(e.strong,{children:"é»è®¤å¼ï¼"})," ",(0,n.jsx)(e.code,{children:"[]"})]}),"\n"]}),"\n",(0,n.jsxs)(e.p,{children:["æé¤ä¸éè¦è¢« ",(0,n.jsx)(e.a,{href:"/zh/guide/configuration/swc.html",children:"SWC"})," ç¼è¯ç JavaScript æ TypeScript æä»¶ã"]}),"\n",(0,n.jsxs)(e.h2,{id:"ç¨æ³",children:[(0,n.jsx)(e.a,{className:"rp-header-anchor","aria-hidden":"true",href:"#ç¨æ³",children:"#"}),"ç¨æ³"]}),"\n",(0,n.jsxs)(e.p,{children:[(0,n.jsx)(e.code,{children:"source.exclude"})," çç¨æ³ä¸ ",(0,n.jsx)(e.a,{href:"/zh/config/source/include.html",children:"source.include"})," ç±»ä¼¼ï¼æ¯æä¼ å
¥åç¬¦ä¸²ææ£åè¡¨è¾¾å¼æ¥å¹é
模åçè·¯å¾ã"]}),"\n",(0,n.jsx)(e.p,{children:"æ¯å¦:"}),"\n",(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(e.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)(e.code,{children:[(0,n.jsxs)(e.span,{className:"line",children:[(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"import"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-foreground)"},children:" path "}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"from"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-string-expression)"},children:" 'node:path'"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-foreground)"},children:";"})]}),"\n",(0,n.jsx)(e.span,{className:"line"}),"\n",(0,n.jsxs)(e.span,{className:"line",children:[(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"export"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:" default"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-foreground)"},children:" {"})]}),"\n",(0,n.jsxs)(e.span,{className:"line",children:[(0,n.jsx)(e.span,{style:{color:"var(--shiki-foreground)"},children:" source"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:":"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-foreground)"},children:" {"})]}),"\n",(0,n.jsxs)(e.span,{className:"line",children:[(0,n.jsx)(e.span,{style:{color:"var(--shiki-foreground)"},children:" exclude"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:":"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-foreground)"},children:" ["}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-constant)"},children:"path"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-function)"},children:".resolve"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-foreground)"},children:"(__dirname"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-punctuation)"},children:","}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-string-expression)"},children:" 'src/module-a'"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-foreground)"},children:")"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-punctuation)"},children:","}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-string-expression)"},children:" /src\\/module-b/"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-foreground)"},children:"]"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-punctuation)"},children:","})]}),"\n",(0,n.jsxs)(e.span,{className:"line",children:[(0,n.jsx)(e.span,{style:{color:"var(--shiki-foreground)"},children:" }"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-punctuation)"},children:","})]}),"\n",(0,n.jsx)(e.span,{className:"line",children:(0,n.jsx)(e.span,{style:{color:"var(--shiki-foreground)"},children:"};"})})]})})}),"\n",(0,n.jsxs)(e.blockquote,{children:["\n",(0,n.jsxs)(e.p,{children:["æ¥ç ",(0,n.jsx)(e.a,{href:"/zh/config/source/include.html",children:"source.include"})," æ¥äºè§£æ´å¤ç¨æ³ã"]}),"\n"]}),"\n",(0,n.jsxs)(e.h2,{id:"ä¼å
级",children:[(0,n.jsx)(e.a,{className:"rp-header-anchor","aria-hidden":"true",href:"#ä¼å
级",children:"#"}),"ä¼å
级"]}),"\n",(0,n.jsxs)(e.p,{children:["å½åæ¶è®¾ç½® ",(0,n.jsx)(e.code,{children:"source.include"})," å ",(0,n.jsx)(e.code,{children:"source.exclude"})," æ¶ï¼",(0,n.jsx)(e.code,{children:"source.exclude"})," å
·ææ´é«çä¼å
级ã"]}),"\n",(0,n.jsxs)(e.p,{children:["ä¾å¦ï¼å¨ä¸é¢ç示ä¾ä¸
1ï¼è½ç¶ ",(0,n.jsx)(e.code,{children:"source.include"})," å¹é
äºæ´ä¸ª ",(0,n.jsx)(e.code,{children:"src"})," ç®å½ï¼ä½ ",(0,n.jsx)(e.code,{children:"src/foo"})," ç®å½ä¸ç JavaScript æä»¶ä¸ä¼è¢« SWC ç¼è¯ï¼"]}),"\n",(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(e.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)(e.code,{children:[(0,n.jsxs)(e.span,{className:"line",children:[(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"import"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-foreground)"},children:" path "}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"from"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-string-expression)"},children:" 'node:path'"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-foreground)"},children:";"})]}),"\n",(0,n.jsx)(e.span,{className:"line"}),"\n",(0,n.jsxs)(e.span,{className:"line",children:[(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"export"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:" default"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-foreground)"},children:" {"})]}),"\n",(0,n.jsxs)(e.span,{className:"line",children:[(0,n.jsx)(e.span,{style:{color:"var(--shiki-foreground)"},children:" source"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:":"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-foreground)"},children:" {"})]}),"\n",(0,n.jsxs)(e.span,{className:"line",children:[(0,n.jsx)(e.span,{style:{color:"var(--shiki-foreground)"},children:" include"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:":"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-foreground)"},children:" ["}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-constant)"},children:"path"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-function)"},children:".resolve"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-foreground)"},children:"(__dirname"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-punctuation)"},children:","}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-string-expression)"},children:" 'src'"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-foreground)"},children:")]"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-punctuation)"},children:","})]}),"\n",(0,n.jsxs)(e.span,{className:"line",children:[(0,n.jsx)(e.span,{style:{color:"var(--shiki-foreground)"},children:" exclude"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:":"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-foreground)"},children:" ["}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-constant)"},children:"path"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-function)"},children:".resolve"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-foreground)"},children:"(__dirname"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-punctuation)"},children:","}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-string-expression)"},children:" 'src/foo'"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-foreground)"},children:")]"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-punctuation)"},children:","})]}),"\n",(0,n.jsxs)(e.span,{className:"line",children:[(0,n.jsx)(e.span,{style:{color:"var(--shiki-foreground)"},children:" }"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-punctuation)"},children:","})]}),"\n",(0,n.jsx)(e.span,{className:"line",children:(0,n.jsx)(e.span,{style:{color:"var(--shiki-foreground)"},children:"};"})})]})})}),"\n",(0,n.jsxs)(e.h2,{id:"æé¤æå
",children:[(0,n.jsx)(e.a,{className:"rp-header-anchor","aria-hidden":"true",href:"#æé¤æå
",children:"#"}),"æé¤æå
"]}),"\n",(0,n.jsxs)(e.p,{children:[(0,n.jsx)(e.code,{children:"source.exclude"})," ç¨äºæå®ä¸éè¦ç¼è¯ç JavaScript/TypeScript æä»¶ãè¿æå³çè¿äºæä»¶ä¸ä¼ç»è¿ SWC 转è¯ï¼ä½è¢«å¼ç¨çæä»¶ä»ç¶ä¼è¢«æå
å°äº§ç©ä¸ã"]}),"\n",(0,n.jsxs)(e.p,{children:["å¦æä½ å¸ææäºæä»¶å¨æå
è¿ç¨ä¸è¢«æé¤ï¼ä¸è¢«æå
å°äº§ç©ä¸ï¼å¯ä»¥ä½¿ç¨ Rspack ç ",(0,n.jsx)(e.a,{href:"https://rspack.rs/zh/plugins/ignore-plugin",rel:"noopener noreferrer",target:"_blank",children:"IgnorePlugin"}),"ã"]}),"\n",(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(e.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)(e.code,{children:[(0,n.jsxs)(e.span,{className:"line",children:[(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"export"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:" default"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-foreground)"},children:" {"})]}),"\n",(0,n.jsxs)(e.span,{className:"line",children:[(0,n.jsx)(e.span,{style:{color:"var(--shiki-foreground)"},children:" tools"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:":"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-foreground)"},children:" {"})]}),"\n",(0,n.jsxs)(e.span,{className:"line",children:[(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-function)"},children:" rspack"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:":"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-foreground)"},children:" (config"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-punctuation)"},children:","}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-foreground)"},children:" { rspack }) "}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"=>"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-foreground)"},children:" {"})]}),"\n",(0,n.jsxs)(e.span,{className:"line",children:[(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-constant)"},children:" config"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-function)"},children:"."}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-constant)"},children:"plugins"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-function)"},children:".push"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-foreground)"},children:"("})]}),"\n",(0,n.jsxs)(e.span,{className:"line",children:[(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:" new"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-constant)"},children:" rspack"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-function)"},children:".IgnorePlugin"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-foreground)"},children:"({"})]}),"\n",(0,n.jsxs)(e.span,{className:"line",children:[(0,n.jsx)(e.span,{style:{color:"var(--shiki-foreground)"},children:" resourceRegExp"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:":"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-string-expression)"},children:" /"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"^"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-string-expression)"},children:"\\.\\/locale"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"$"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-string-expression)"},children:"/"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-punctuation)"},children:","})]}),"\n",(0,n.jsxs)(e.span,{className:"line",children:[(0,n.jsx)(e.span,{style:{color:"var(--shiki-foreground)"},children:" contextRegExp"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:":"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-string-expression)"},children:" /moment"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:"$"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-string-expression)"},children:"/"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-punctuation)"},children:","})]}),"\n",(0,n.jsxs)(e.span,{className:"line",children:[(0,n.jsx)(e.span,{style:{color:"var(--shiki-foreground)"},children:" })"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-punctuation)"},children:","})]}),"\n",(0,n.jsx)(e.span,{className:"line",children:(0,n.jsx)(e.span,{style:{color:"var(--shiki-foreground)"},children:" );"})}),"\n",(0,n.jsxs)(e.span,{className:"line",children:[(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-keyword)"},children:" return"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-foreground)"},children:" config;"})]}),"\n",(0,n.jsxs)(e.span,{className:"line",children:[(0,n.jsx)(e.span,{style:{color:"var(--shiki-foreground)"},children:" }"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-punctuation)"},children:","})]}),"\n",(0,n.jsxs)(e.span,{className:"line",children:[(0,n.jsx)(e.span,{style:{color:"var(--shiki-foreground)"},children:" }"}),(0,n.jsx)(e.span,{style:{color:"var(--shiki-token-punctuation)"},children:","})]}),"\n",(0,n.jsx)(e.span,{className:"line",children:(0,n.jsx)(e.span,{style:{color:"var(--shiki-foreground)"},children:"};"})})]})})})]})}function l(){let s=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{wrapper:e}={...(0,i.R)(),...s.components};return e?(0,n.jsx)(e,{...s,children:(0,n.jsx)(o,{...s})}):o(s)}l.__RSPRESS_PAGE_META={},l.__RSPRESS_PAGE_META["zh%2Fconfig%2Fsource%2Fexclude.mdx"]={toc:[{id:"ç¨æ³",text:"ç¨æ³",depth:2},{id:"ä¼å
级",text:"ä¼å
级",depth:2},{id:"æé¤æå
",text:"æé¤æå
",depth:2}],title:"source.exclude",headingTitle:"source.exclude",frontmatter:{description:"æé¤ä¸éè¦è¢« SWC ç¼è¯ç JavaScript æ TypeScript æä»¶ã"}},r.d(e,{default:()=>l})}}]);
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.