1"use strict";(self.rspackChunkrsbuild_website=self.rspackChunkrsbuild_website||[]).push([["8a"],{Uo(s,r,e){e.r(r);var n=e("E"),i=e("H"),o=e("x");function l(s){let r={a:"a",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)(r.h1,{id:"root",children:[(0,n.jsx)(r.a,{className:"rp-header-anchor","aria-hidden":"true",href:"#root",children:"#"}),"root"]}),"\n",(0,n.jsxs)(r.ul,{children:["\n",(0,n.jsxs)(r.li,{children:[(0,n.jsx)(r.strong,{children:"ç±»åï¼"})," ",(0,n.jsx)(r.code,{children:"string"})]}),"\n",(0,n.jsxs)(r.li,{children:[(0,n.jsx)(r.strong,{children:"é»è®¤å¼ï¼"})," ",(0,n.jsx)(r.a,{href:"https://nodejs.org/api/process.html#processcwd",rel:"noopener noreferrer",target:"_blank",children:"process.cwd()"})]}),"\n"]}),"\n",(0,n.jsxs)(r.p,{children:["æå®é¡¹ç®æ ¹ç®å½ãå¯ä»¥æ¯ç»å¯¹è·¯å¾ï¼ä¹å¯ä»¥æ¯ç¸å¯¹äº ",(0,n.jsx)(r.code,{children:"process.cwd()"})," çè·¯å¾ã"]}),"\n",(0,n.jsxs)(r.p,{children:["Rsbuild ",(0,n.jsx)(r.code,{children:"root"})," çå¼ä¹ä¼ä¼ éç» Rspack ç ",(0,n.jsx)(r.a,{href:"https://rspack.rs/zh/config/context",rel:"noopener noreferrer",target:"_blank",children:"context"})," é
ç½®ã"]}),"\n",(0,n.jsxs)(o.Pq,{type:"tip",title:"Tip",children:[(0,n.jsxs)(r.p,{children:["\n",(0,n.jsx)(r.code,{children:"root"})," çå¼ä¸ä¼å½±å ",(0,n.jsx)(r.code,{children:".env"})," æä»¶çå 载路å¾ï¼å 为 ",(0,n.jsx)(r.code,{children:".env"})," æä»¶æ©äº Rsbuild çé
ç½®æä»¶è¢«è§£æã"]}),(0,n.jsxs)(r.p,{children:["Rsbuild CLI æ¯æä½¿ç¨ ",(0,n.jsx)(r.code,{children:"--root"})," éé¡¹æ¥æå®æ ¹ç®å½ï¼å®å¯ä»¥å½±å ",(0,n.jsx)(r.code,{children:".env"})," æä»¶çå 载路å¾ï¼è¯¦è§ ",(0,n.jsx)(r.a,{href:"/zh/guide/basic/cli.html",children:'"CLI"'}),"ã"]})]}),"\n",(0,n.jsxs)(r.h2,{id:"示ä¾",children:[(0,n.jsx)(r.a,{className:"rp-header-anchor","aria-hidden":"true",href:"#示ä¾",children:"#"}),"示ä¾"]}),"\n",(0,n.jsxs)(r.ul,{children:["\n",(0,n.jsx)(r.li,{children:"ç¸å¯¹è·¯å¾ï¼"}),"\n"]}),"\n",(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(r.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)(r.code,{children:[(0,n.jsxs)(r.span,{className:"line",children:[(0,n.jsx)(r.span,{style:{color:"var(--shiki-token-keyword)"},children:"export"}),(0,n.jsx)(r.span,{style:{color:"var(--shiki-token-keyword)"},children:" default"}),(0,n.jsx)(r.span,{style:{color:"var(--shiki-foreground)"},children:" {"})]}),"\n",(0,n.jsxs)(r.span,{className:"line",children:[(0,n.jsx)(r.span,{style:{color:"var(--shiki-foreground)"},children:" root"}),(0,n.jsx)(r.span,{style:{color:"var(--shiki-token-keyword)"},children:":"}),(0,n.jsx)(r.span,{style:{color:"var(--shiki-token-string-expression)"},children:" './foo'"}),(0,n.jsx)(r.span,{style:{color:"var(--shiki-token-punctuation)"},children:","})]}),"\n",(0,n.jsx)(r.span,{className:"line",children:(0,n.jsx)(r.span,{style:{color:"var(--shiki-foreground)"},children:"};"})})]})})}),"\n",(0,n.jsxs)(r.ul,{children:["\n",(0,n.jsx)(r.li,{children:"ç»å¯¹è·¯å¾ï¼"}),"\n"]}),"\n",(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(r.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)(r.code,{children:[(0,n.jsxs)(r.span,{className:"line",children:[(0,n.jsx)(r.span,{style:{color:"var(--shiki-token-keyword)"},children:"import"}),(0,n.jsx)(r.span,{style:{color:"var(--shiki-foreground)"},children:" { join } "}),(0,n.jsx)(r.span,{style:{color:"var(--shiki-token-keyword)"},children:"from"}),(0,n.jsx)(r.span,{style:{color:"var(--shiki-token-string-expression)"},children:" 'node:path'"}),(0,n.jsx)(r.span,{style:{color:"var(--shiki-foreground)"},children:";"})]}),"\n",(0,n.jsx)(r.span,{className:"line"}),"\n",(0,n.jsxs)(r.span,{className:"line",children:[(0,n.jsx)(r.span,{style:{color:"var(--shiki-token-keyword)"},children:"export"}),(0,n.jsx)(r.span,{style:{color:"var(--shiki-token-keyword)"},children:" default"}),(0,n.jsx)(r.span,{style:{color:"var(--shiki-foreground)"},children:" {"})]}),"\n",(0,n.jsxs)(r.span,{className:"line",children:[(0,n.jsx)(r.span,{style:{color:"var(--shiki-foreground)"},children:" root"}),(0,n.jsx)(r.span,{style:{color:"var(--shiki-token-keyword)"},children:":"}),(0,n.jsx)(r.span,{style:{color:"var(--shiki-token-function)"},children:" join"}),(0,n.jsx)(r.span,{style:{color:"var(--shiki-foreground)"},children:"(__dirname"}),(0,n.jsx)(r.span,{style:{color:"var(--shiki-token-punctuation)"},children:","}),(0,n.jsx)(r.span,{style:{color:"var(--shiki-token-string-expression)"},children:" 'foo'"}),(0,n.jsx)(r.span,{style:{color:"var(--shiki-foreground)"},children:")"}),(0,n.jsx)(r.span,{style:{color:"var(--shiki-token-punctuation)"},children:","})]}),"\n",(0,n.jsx)(r.span,{className:"line",children:(0,n.jsx)(r.span,{style:{color:"var(--shiki-foreground)"},children:"};"})})]})})})]})}function c(){let s=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{wrapper:r}={...(0,i.R)(),...s.components};return r?(0,n.jsx)(r,{...s,children:(0,n.jsx)(l,{...s})}):l(s)}c.__RSPRESS_PAGE_META={},c.__RSPRESS_PAGE_META["zh%2Fconfig%2Froot.mdx"]={toc:[{id:"示ä¾",text:"示ä¾",depth:2}],title:"root",headingTitle:"root",frontmatter:{description:"æå®é¡¹ç®æ ¹ç®å½ãå¯ä»¥æ¯ç»å¯¹è·¯å¾ï¼ä¹å¯ä»¥æ¯ç¸å¯¹äº process.cwd() çè·¯å¾ã"}},e.d(r,{default:()=>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.