PageSourceSearch

https://rspack.rs/static/js/async/route-87f4e73ea267.34b2e2134a.js

js rspack.rs collected 2026-09-24 17:15:03 UTC 3,292 bytes, 1 lines download raw bytes

1"use strict";(self.rspackChunkrspack_website=self.rspackChunkrspack_website||[]).push([["8q"],{r7(e,r,a){a.r(r);var d=a("i"),i=a("f");function l(e){let r={a:"a",code:"code",h1:"h1",h2:"h2",li:"li",p:"p",ul:"ul",...(0,i.R)(),...e.components};return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)(r.h1,{id:"总览",children:[(0,d.jsx)(r.a,{className:"rp-header-anchor","aria-hidden":"true",href:"#总览",children:"#"}),"总览"]}),"\n",(0,d.jsxs)(r.h2,{id:"兼容性",children:[(0,d.jsx)(r.a,{className:"rp-header-anchor","aria-hidden":"true",href:"#兼容性",children:"#"}),"兼容性"]}),"\n",(0,d.jsx)(r.p,{children:"Rspack 致力于兼容 webpack 生态中的 loader。我们确保 Rspack 尽可能地去兼容 webpack 的 loader API,使更多现有的 webpack loader 能够在 Rspack 中直接使用。"}),"\n",(0,d.jsxs)(r.p,{children:["目前 Rspack 已经兼容了 webpack 绝大部分的 loader API,如果你发现某个 webpack loader 无法在 Rspack 中使用,欢迎到 ",(0,d.jsx)(r.a,{href:"https://github.com/web-infra-dev/rspack",rel:"noopener noreferrer",target:"_blank",children:"Rspack 仓库"})," 通过 issue 反馈。"]}),"\n",(0,d.jsxs)(r.h2,{id:"编写-loader",children:[(0,d.jsx)(r.a,{className:"rp-header-anchor","aria-hidden":"true",href:"#编写-loader",children:"#"}),"编写 Loader"]}),"\n",(0,d.jsxs)(r.p,{children:["我们提供了不同类型 loader 的一些基本示例,如果你想要编写一个 loader,可以参考 ",(0,d.jsx)(r.a,{href:"/zh/api/loader-api/writing-loaders.html",children:"编写 Loader"})," 来上手。"]}),"\n",(0,d.jsxs)(r.p,{children:["如果你需要使用一个已有的 loader,可以参考 ",(0,d.jsx)(r.a,{href:"/zh/guide/features/loader.html",children:"特性 - loader"})," 来了解如何使用。"]}),"\n",(0,d.jsxs)(r.h2,{id:"loader-api",children:[(0,d.jsx)(r.a,{className:"rp-header-anchor","aria-hidden":"true",href:"#loader-api",children:"#"}),"Loader API"]}),"\n",(0,d.jsx)(r.p,{children:"Loader API 包含:"}),"\n",(0,d.jsxs)(r.ul,{children:["\n",(0,d.jsxs)(r.li,{children:[(0,d.jsx)(r.a,{href:"/zh/api/loader-api/context.html",children:"Loader 上下文"}),":表示 loader 内部可用的属性,这些属性在 loader 中通过 ",(0,d.jsx)(r.code,{children:"this"})," 属性进行访问。"]}),"\n",(0,d.jsxs)(r.li,{children:[(0,d.jsx)(r.a,{href:"/zh/api/loader-api/inline.html",children:"内联 loader"}),":在 ",(0,d.jsx)(r.code,{children:"import"})," 语句中指定 loader。"]}),"\n",(0,d.jsxs)(r.li,{children:[(0,d.jsx)(r.a,{href:"/zh/api/loader-api/inline-match-resource.html",children:"内联 matchResource"}),":允许你在加载资源时动态改变匹配规则。"]}),"\n"]})]})}function h(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{wrapper:r}={...(0,i.R)(),...e.components};return r?(0,d.jsx)(r,{...e,children:(0,d.jsx)(l,{...e})}):l(e)}h.__RSPRESS_PAGE_META={},h.__RSPRESS_PAGE_META["zh%2Fapi%2Floader-api%2Findex.mdx"]={toc:[{id:"兼容性",text:"兼容性",depth:2},{id:"编写-loader",text:"编写 Loader",depth:2},{id:"loader-api",text:"Loader API",depth:2}],title:"总览",headingTitle:"总览",frontmatter:{description:"Rspack Loader API 总览,涵盖 Loader Context、内联语法、自定义能力与 Loader 编写方式。"}},a.d(r,{default:()=>h})}}]);

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.