@rsbuild/core 0.0.24 → 0.0.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/rsbuild.js +4 -25
- package/compiled/jiti/index.js +1885 -0
- package/compiled/jiti/license +21 -0
- package/compiled/jiti/package.json +1 -0
- package/compiled/jiti/types/jiti.d.ts +19 -0
- package/compiled/jiti/types/types.d.ts +31 -0
- package/compiled/sirv/index.js +1 -0
- package/compiled/sirv/package.json +1 -0
- package/compiled/sirv/sirv.d.ts +27 -0
- package/dist/cli/commands.d.ts +8 -4
- package/dist/cli/commands.js +49 -10
- package/dist/cli/config.d.ts +2 -2
- package/dist/cli/config.js +15 -6
- package/dist/cli/prepare.d.ts +1 -0
- package/dist/cli/{run.js → prepare.js} +19 -17
- package/dist/createRsbuild.d.ts +1 -2
- package/dist/createRsbuild.js +4 -10
- package/dist/index.d.ts +9 -4
- package/dist/index.js +2 -4
- package/dist/plugins/asset.d.ts +2 -2
- package/dist/plugins/bundleAnalyzer.d.ts +2 -2
- package/dist/plugins/cache.d.ts +2 -2
- package/dist/plugins/cache.js +0 -3
- package/dist/plugins/cleanOutput.d.ts +2 -2
- package/dist/plugins/define.d.ts +2 -2
- package/dist/plugins/devtool.d.ts +2 -2
- package/dist/plugins/entry.d.ts +1 -1
- package/dist/plugins/externals.d.ts +2 -2
- package/dist/plugins/fileSize.d.ts +2 -2
- package/dist/plugins/fileSize.js +2 -2
- package/dist/plugins/html.d.ts +3 -2
- package/dist/plugins/inlineChunk.d.ts +2 -2
- package/dist/plugins/moment.d.ts +2 -2
- package/dist/plugins/networkPerformance.d.ts +2 -2
- package/dist/plugins/nodeAddons.d.ts +2 -2
- package/dist/plugins/performance.d.ts +2 -2
- package/dist/plugins/preloadOrPrefetch.d.ts +2 -2
- package/dist/plugins/splitChunks.d.ts +2 -2
- package/dist/plugins/startUrl.d.ts +2 -2
- package/dist/plugins/target.d.ts +2 -2
- package/dist/plugins/toml.d.ts +2 -2
- package/dist/plugins/wasm.d.ts +2 -2
- package/dist/plugins/yaml.d.ts +2 -2
- package/dist/{rspack-provider/rspackPlugin/removeCssSourcemapPlugin.js → rspack-plugins/RemoveCssSourcemapPlugin.js} +3 -3
- package/dist/rspack-provider/config.d.ts +9 -0
- package/dist/rspack-provider/{config/defaults.js → config.js} +9 -3
- package/dist/rspack-provider/core/createCompiler.d.ts +1 -1
- package/dist/rspack-provider/core/createContext.d.ts +8 -2
- package/dist/rspack-provider/core/createContext.js +90 -5
- package/dist/rspack-provider/core/initConfigs.d.ts +1 -1
- package/dist/rspack-provider/core/initConfigs.js +4 -3
- package/dist/rspack-provider/core/initHooks.d.ts +2 -2
- package/dist/rspack-provider/core/initPlugins.d.ts +1 -1
- package/dist/rspack-provider/core/initPlugins.js +2 -1
- package/dist/rspack-provider/core/rspackConfig.d.ts +1 -1
- package/dist/rspack-provider/index.d.ts +3 -3
- package/dist/rspack-provider/index.js +11 -4
- package/dist/rspack-provider/plugins/basic.d.ts +1 -1
- package/dist/rspack-provider/plugins/css.d.ts +1 -1
- package/dist/rspack-provider/plugins/css.js +3 -11
- package/dist/rspack-provider/plugins/hmr.d.ts +1 -1
- package/dist/rspack-provider/plugins/less.d.ts +1 -1
- package/dist/rspack-provider/plugins/minimize.d.ts +1 -1
- package/dist/rspack-provider/plugins/output.d.ts +1 -1
- package/dist/rspack-provider/plugins/progress.d.ts +1 -1
- package/dist/rspack-provider/plugins/resolve.d.ts +1 -1
- package/dist/rspack-provider/plugins/rspackProfile.d.ts +1 -1
- package/dist/rspack-provider/plugins/sass.d.ts +1 -1
- package/dist/rspack-provider/plugins/swc.d.ts +1 -1
- package/dist/rspack-provider/plugins/transition.d.ts +1 -1
- package/dist/rspack-provider/provider.d.ts +1 -1
- package/dist/rspack-provider/provider.js +5 -6
- package/dist/rspack-provider/shared.d.ts +8 -0
- package/dist/rspack-provider/shared.js +116 -0
- package/dist/server/prodServer.js +1 -1
- package/dist/server/restart.js +2 -4
- package/dist/types.d.ts +19 -0
- package/dist/{rspack-provider/types/plugin.js → types.js} +2 -2
- package/package.json +5 -7
- package/dist/cli/index.d.ts +0 -2
- package/dist/cli/index.js +0 -31
- package/dist/cli/run.d.ts +0 -5
- package/dist/rspack-provider/config/defaults.d.ts +0 -3
- package/dist/rspack-provider/config/normalize.d.ts +0 -7
- package/dist/rspack-provider/config/normalize.js +0 -33
- package/dist/rspack-provider/shared/constants.d.ts +0 -1
- package/dist/rspack-provider/shared/constants.js +0 -28
- package/dist/rspack-provider/shared/fs.d.ts +0 -1
- package/dist/rspack-provider/shared/fs.js +0 -38
- package/dist/rspack-provider/shared/index.d.ts +0 -3
- package/dist/rspack-provider/shared/index.js +0 -26
- package/dist/rspack-provider/shared/plugin.d.ts +0 -3
- package/dist/rspack-provider/shared/plugin.js +0 -75
- package/dist/rspack-provider/shared/rspackVersion.d.ts +0 -3
- package/dist/rspack-provider/shared/rspackVersion.js +0 -61
- package/dist/rspack-provider/types/context.d.ts +0 -16
- package/dist/rspack-provider/types/context.js +0 -16
- package/dist/rspack-provider/types/index.d.ts +0 -3
- package/dist/rspack-provider/types/index.js +0 -24
- package/dist/rspack-provider/types/plugin.d.ts +0 -4
- /package/dist/{rspack-provider/rspackPlugin/removeCssSourcemapPlugin.d.ts → rspack-plugins/RemoveCssSourcemapPlugin.d.ts} +0 -0
- /package/dist/rspack-provider/{rspackLoader/css-modules-typescript-pre-loader → css-modules-typescript-pre-loader}/index.d.ts +0 -0
- /package/dist/rspack-provider/{rspackLoader/css-modules-typescript-pre-loader → css-modules-typescript-pre-loader}/index.js +0 -0
- /package/dist/rspack-provider/{rspackLoader/css-modules-typescript-pre-loader → css-modules-typescript-pre-loader}/postcss-icss-extract-plugin.d.ts +0 -0
- /package/dist/rspack-provider/{rspackLoader/css-modules-typescript-pre-loader → css-modules-typescript-pre-loader}/postcss-icss-extract-plugin.js +0 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) Pooya Parsa <pooya@pi0.io>
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"name":"jiti","version":"1.20.0","license":"MIT","types":"types/jiti.d.ts"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { Module } from 'module';
|
|
3
|
+
import { TransformOptions, JITIOptions } from './types';
|
|
4
|
+
export type { JITIOptions, TransformOptions } from "./types";
|
|
5
|
+
type Require = typeof require;
|
|
6
|
+
type Module = typeof module;
|
|
7
|
+
type ModuleCache = Record<string, Module>;
|
|
8
|
+
export type EvalModuleOptions = Partial<{
|
|
9
|
+
id: string;
|
|
10
|
+
filename: string;
|
|
11
|
+
ext: string;
|
|
12
|
+
cache: ModuleCache;
|
|
13
|
+
}>;
|
|
14
|
+
export interface JITI extends Require {
|
|
15
|
+
transform: (opts: TransformOptions) => string;
|
|
16
|
+
register: () => () => void;
|
|
17
|
+
evalModule: (source: string, options?: EvalModuleOptions) => unknown;
|
|
18
|
+
}
|
|
19
|
+
export default function createJITI(_filename: string, opts?: JITIOptions, parentModule?: Module, parentCache?: ModuleCache): JITI;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export type TransformOptions = {
|
|
2
|
+
source: string;
|
|
3
|
+
filename?: string;
|
|
4
|
+
ts?: boolean;
|
|
5
|
+
retainLines?: boolean;
|
|
6
|
+
legacy?: boolean;
|
|
7
|
+
[key: string]: any;
|
|
8
|
+
};
|
|
9
|
+
export type TRANSFORM_RESULT = {
|
|
10
|
+
code: string;
|
|
11
|
+
error?: any;
|
|
12
|
+
};
|
|
13
|
+
export type JITIOptions = {
|
|
14
|
+
transform?: (opts: TransformOptions) => TRANSFORM_RESULT;
|
|
15
|
+
debug?: boolean;
|
|
16
|
+
cache?: boolean | string;
|
|
17
|
+
sourceMaps?: boolean;
|
|
18
|
+
requireCache?: boolean;
|
|
19
|
+
v8cache?: boolean;
|
|
20
|
+
interopDefault?: boolean;
|
|
21
|
+
esmResolve?: boolean;
|
|
22
|
+
cacheVersion?: string;
|
|
23
|
+
onError?: (error: Error) => void;
|
|
24
|
+
legacy?: boolean;
|
|
25
|
+
extensions?: string[];
|
|
26
|
+
transformOptions?: Omit<TransformOptions, "source">;
|
|
27
|
+
alias?: Record<string, string>;
|
|
28
|
+
nativeModules?: string[];
|
|
29
|
+
transformModules?: string[];
|
|
30
|
+
experimentalBun?: boolean;
|
|
31
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(()=>{var i={899:(i,t,a)=>{const e=a(477);function parse(i){let t=i.url;if(t==null)return;let a=i._parsedUrl;if(a&&a.raw===t)return a;let p=t,l="",o;if(t.length>1){let i=t.indexOf("?",1);if(i!==-1){l=t.substring(i);p=t.substring(0,i);if(l.length>1){o=e.parse(l.substring(1))}}}return i._parsedUrl={pathname:p,search:l,query:o,raw:t}}t.parse=parse},245:(i,t)=>{const a={ez:"application/andrew-inset",aw:"application/applixware",atom:"application/atom+xml",atomcat:"application/atomcat+xml",atomdeleted:"application/atomdeleted+xml",atomsvc:"application/atomsvc+xml",dwd:"application/atsc-dwd+xml",held:"application/atsc-held+xml",rsat:"application/atsc-rsat+xml",bdoc:"application/bdoc",xcs:"application/calendar+xml",ccxml:"application/ccxml+xml",cdfx:"application/cdfx+xml",cdmia:"application/cdmi-capability",cdmic:"application/cdmi-container",cdmid:"application/cdmi-domain",cdmio:"application/cdmi-object",cdmiq:"application/cdmi-queue",cu:"application/cu-seeme",mpd:"application/dash+xml",davmount:"application/davmount+xml",dbk:"application/docbook+xml",dssc:"application/dssc+der",xdssc:"application/dssc+xml",es:"application/ecmascript",ecma:"application/ecmascript",emma:"application/emma+xml",emotionml:"application/emotionml+xml",epub:"application/epub+zip",exi:"application/exi",fdt:"application/fdt+xml",pfr:"application/font-tdpfr",geojson:"application/geo+json",gml:"application/gml+xml",gpx:"application/gpx+xml",gxf:"application/gxf",gz:"application/gzip",hjson:"application/hjson",stk:"application/hyperstudio",ink:"application/inkml+xml",inkml:"application/inkml+xml",ipfix:"application/ipfix",its:"application/its+xml",jar:"application/java-archive",war:"application/java-archive",ear:"application/java-archive",ser:"application/java-serialized-object",class:"application/java-vm",js:"application/javascript",mjs:"application/javascript",json:"application/json",map:"application/json",json5:"application/json5",jsonml:"application/jsonml+json",jsonld:"application/ld+json",lgr:"application/lgr+xml",lostxml:"application/lost+xml",hqx:"application/mac-binhex40",cpt:"application/mac-compactpro",mads:"application/mads+xml",webmanifest:"application/manifest+json",mrc:"application/marc",mrcx:"application/marcxml+xml",ma:"application/mathematica",nb:"application/mathematica",mb:"application/mathematica",mathml:"application/mathml+xml",mbox:"application/mbox",mscml:"application/mediaservercontrol+xml",metalink:"application/metalink+xml",meta4:"application/metalink4+xml",mets:"application/mets+xml",maei:"application/mmt-aei+xml",musd:"application/mmt-usd+xml",mods:"application/mods+xml",m21:"application/mp21",mp21:"application/mp21",mp4s:"application/mp4",m4p:"application/mp4",doc:"application/msword",dot:"application/msword",mxf:"application/mxf",nq:"application/n-quads",nt:"application/n-triples",cjs:"application/node",bin:"application/octet-stream",dms:"application/octet-stream",lrf:"application/octet-stream",mar:"application/octet-stream",so:"application/octet-stream",dist:"application/octet-stream",distz:"application/octet-stream",pkg:"application/octet-stream",bpk:"application/octet-stream",dump:"application/octet-stream",elc:"application/octet-stream",deploy:"application/octet-stream",exe:"application/octet-stream",dll:"application/octet-stream",deb:"application/octet-stream",dmg:"application/octet-stream",iso:"application/octet-stream",img:"application/octet-stream",msi:"application/octet-stream",msp:"application/octet-stream",msm:"application/octet-stream",buffer:"application/octet-stream",oda:"application/oda",opf:"application/oebps-package+xml",ogx:"application/ogg",omdoc:"application/omdoc+xml",onetoc:"application/onenote",onetoc2:"application/onenote",onetmp:"application/onenote",onepkg:"application/onenote",oxps:"application/oxps",relo:"application/p2p-overlay+xml",xer:"application/patch-ops-error+xml",pdf:"application/pdf",pgp:"application/pgp-encrypted",asc:"application/pgp-signature",sig:"application/pgp-signature",prf:"application/pics-rules",p10:"application/pkcs10",p7m:"application/pkcs7-mime",p7c:"application/pkcs7-mime",p7s:"application/pkcs7-signature",p8:"application/pkcs8",ac:"application/pkix-attr-cert",cer:"application/pkix-cert",crl:"application/pkix-crl",pkipath:"application/pkix-pkipath",pki:"application/pkixcmp",pls:"application/pls+xml",ai:"application/postscript",eps:"application/postscript",ps:"application/postscript",provx:"application/provenance+xml",cww:"application/prs.cww",pskcxml:"application/pskc+xml",raml:"application/raml+yaml",rdf:"application/rdf+xml",owl:"application/rdf+xml",rif:"application/reginfo+xml",rnc:"application/relax-ng-compact-syntax",rl:"application/resource-lists+xml",rld:"application/resource-lists-diff+xml",rs:"application/rls-services+xml",rapd:"application/route-apd+xml",sls:"application/route-s-tsid+xml",rusd:"application/route-usd+xml",gbr:"application/rpki-ghostbusters",mft:"application/rpki-manifest",roa:"application/rpki-roa",rsd:"application/rsd+xml",rss:"application/rss+xml",rtf:"application/rtf",sbml:"application/sbml+xml",scq:"application/scvp-cv-request",scs:"application/scvp-cv-response",spq:"application/scvp-vp-request",spp:"application/scvp-vp-response",sdp:"application/sdp",senmlx:"application/senml+xml",sensmlx:"application/sensml+xml",setpay:"application/set-payment-initiation",setreg:"application/set-registration-initiation",shf:"application/shf+xml",siv:"application/sieve",sieve:"application/sieve",smi:"application/smil+xml",smil:"application/smil+xml",rq:"application/sparql-query",srx:"application/sparql-results+xml",gram:"application/srgs",grxml:"application/srgs+xml",sru:"application/sru+xml",ssdl:"application/ssdl+xml",ssml:"application/ssml+xml",swidtag:"application/swid+xml",tei:"application/tei+xml",teicorpus:"application/tei+xml",tfi:"application/thraud+xml",tsd:"application/timestamped-data",toml:"application/toml",trig:"application/trig",ttml:"application/ttml+xml",ubj:"application/ubjson",rsheet:"application/urc-ressheet+xml",td:"application/urc-targetdesc+xml",vxml:"application/voicexml+xml",wasm:"application/wasm",wgt:"application/widget",hlp:"application/winhlp",wsdl:"application/wsdl+xml",wspolicy:"application/wspolicy+xml",xaml:"application/xaml+xml",xav:"application/xcap-att+xml",xca:"application/xcap-caps+xml",xdf:"application/xcap-diff+xml",xel:"application/xcap-el+xml",xns:"application/xcap-ns+xml",xenc:"application/xenc+xml",xhtml:"application/xhtml+xml",xht:"application/xhtml+xml",xlf:"application/xliff+xml",xml:"application/xml",xsl:"application/xml",xsd:"application/xml",rng:"application/xml",dtd:"application/xml-dtd",xop:"application/xop+xml",xpl:"application/xproc+xml",xslt:"application/xml",xspf:"application/xspf+xml",mxml:"application/xv+xml",xhvml:"application/xv+xml",xvml:"application/xv+xml",xvm:"application/xv+xml",yang:"application/yang",yin:"application/yin+xml",zip:"application/zip","3gpp":"video/3gpp",adp:"audio/adpcm",amr:"audio/amr",au:"audio/basic",snd:"audio/basic",mid:"audio/midi",midi:"audio/midi",kar:"audio/midi",rmi:"audio/midi",mxmf:"audio/mobile-xmf",mp3:"audio/mpeg",m4a:"audio/mp4",mp4a:"audio/mp4",mpga:"audio/mpeg",mp2:"audio/mpeg",mp2a:"audio/mpeg",m2a:"audio/mpeg",m3a:"audio/mpeg",oga:"audio/ogg",ogg:"audio/ogg",spx:"audio/ogg",opus:"audio/ogg",s3m:"audio/s3m",sil:"audio/silk",wav:"audio/wav",weba:"audio/webm",xm:"audio/xm",ttc:"font/collection",otf:"font/otf",ttf:"font/ttf",woff:"font/woff",woff2:"font/woff2",exr:"image/aces",apng:"image/apng",avif:"image/avif",bmp:"image/bmp",cgm:"image/cgm",drle:"image/dicom-rle",emf:"image/emf",fits:"image/fits",g3:"image/g3fax",gif:"image/gif",heic:"image/heic",heics:"image/heic-sequence",heif:"image/heif",heifs:"image/heif-sequence",hej2:"image/hej2k",hsj2:"image/hsj2",ief:"image/ief",jls:"image/jls",jp2:"image/jp2",jpg2:"image/jp2",jpeg:"image/jpeg",jpg:"image/jpeg",jpe:"image/jpeg",jph:"image/jph",jhc:"image/jphc",jpm:"image/jpm",jpx:"image/jpx",jpf:"image/jpx",jxr:"image/jxr",jxra:"image/jxra",jxrs:"image/jxrs",jxs:"image/jxs",jxsc:"image/jxsc",jxsi:"image/jxsi",jxss:"image/jxss",ktx:"image/ktx",ktx2:"image/ktx2",png:"image/png",btif:"image/prs.btif",pti:"image/prs.pti",sgi:"image/sgi",svg:"image/svg+xml",svgz:"image/svg+xml",t38:"image/t38",tif:"image/tiff",tiff:"image/tiff",tfx:"image/tiff-fx",webp:"image/webp",wmf:"image/wmf","disposition-notification":"message/disposition-notification",u8msg:"message/global",u8dsn:"message/global-delivery-status",u8mdn:"message/global-disposition-notification",u8hdr:"message/global-headers",eml:"message/rfc822",mime:"message/rfc822","3mf":"model/3mf",gltf:"model/gltf+json",glb:"model/gltf-binary",igs:"model/iges",iges:"model/iges",msh:"model/mesh",mesh:"model/mesh",silo:"model/mesh",mtl:"model/mtl",obj:"model/obj",stpz:"model/step+zip",stpxz:"model/step-xml+zip",stl:"model/stl",wrl:"model/vrml",vrml:"model/vrml",x3db:"model/x3d+fastinfoset",x3dbz:"model/x3d+binary",x3dv:"model/x3d-vrml",x3dvz:"model/x3d+vrml",x3d:"model/x3d+xml",x3dz:"model/x3d+xml",appcache:"text/cache-manifest",manifest:"text/cache-manifest",ics:"text/calendar",ifb:"text/calendar",coffee:"text/coffeescript",litcoffee:"text/coffeescript",css:"text/css",csv:"text/csv",html:"text/html",htm:"text/html",shtml:"text/html",jade:"text/jade",jsx:"text/jsx",less:"text/less",markdown:"text/markdown",md:"text/markdown",mml:"text/mathml",mdx:"text/mdx",n3:"text/n3",txt:"text/plain",text:"text/plain",conf:"text/plain",def:"text/plain",list:"text/plain",log:"text/plain",in:"text/plain",ini:"text/plain",dsc:"text/prs.lines.tag",rtx:"text/richtext",sgml:"text/sgml",sgm:"text/sgml",shex:"text/shex",slim:"text/slim",slm:"text/slim",spdx:"text/spdx",stylus:"text/stylus",styl:"text/stylus",tsv:"text/tab-separated-values",t:"text/troff",tr:"text/troff",roff:"text/troff",man:"text/troff",me:"text/troff",ms:"text/troff",ttl:"text/turtle",uri:"text/uri-list",uris:"text/uri-list",urls:"text/uri-list",vcard:"text/vcard",vtt:"text/vtt",yaml:"text/yaml",yml:"text/yaml","3gp":"video/3gpp","3g2":"video/3gpp2",h261:"video/h261",h263:"video/h263",h264:"video/h264",m4s:"video/iso.segment",jpgv:"video/jpeg",jpgm:"image/jpm",mj2:"video/mj2",mjp2:"video/mj2",ts:"video/mp2t",mp4:"video/mp4",mp4v:"video/mp4",mpg4:"video/mp4",mpeg:"video/mpeg",mpg:"video/mpeg",mpe:"video/mpeg",m1v:"video/mpeg",m2v:"video/mpeg",ogv:"video/ogg",qt:"video/quicktime",mov:"video/quicktime",webm:"video/webm"};function lookup(i){let t=(""+i).trim().toLowerCase();let e=t.lastIndexOf(".");return a[!~e?t:t.substring(++e)]}t.lookup=lookup;t.mimes=a},952:(i,t,a)=>{const e=a(147);const{join:p,normalize:l,resolve:o}=a(17);const{totalist:s}=a(102);const{parse:n}=a(899);const{lookup:m}=a(245);const noop=()=>{};function isMatch(i,t){for(let a=0;a<t.length;a++){if(t[a].test(i))return true}}function toAssume(i,t){let a=0,e,p=i.length-1;if(i.charCodeAt(p)===47){i=i.substring(0,p)}let l=[],o=`${i}/index`;for(;a<t.length;a++){e=t[a]?`.${t[a]}`:"";if(i)l.push(i+e);l.push(o+e)}return l}function viaCache(i,t,a){let e=0,p,l=toAssume(t,a);for(;e<l.length;e++){if(p=i[l[e]])return p}}function viaLocal(i,t,a,o){let s=0,n=toAssume(a,o);let m,c,r,x;for(;s<n.length;s++){m=l(p(i,r=n[s]));if(m.startsWith(i)&&e.existsSync(m)){c=e.statSync(m);if(c.isDirectory())continue;x=toHeaders(r,c,t);x["Cache-Control"]=t?"no-cache":"no-store";return{abs:m,stats:c,headers:x}}}}function is404(i,t){return t.statusCode=404,t.end()}function send(i,t,a,p,l){let o=200,s,n={};l={...l};for(let i in l){s=t.getHeader(i);if(s)l[i]=s}if(s=t.getHeader("content-type")){l["Content-Type"]=s}if(i.headers.range){o=206;let[a,e]=i.headers.range.replace("bytes=","").split("-");let s=n.end=parseInt(e,10)||p.size-1;let m=n.start=parseInt(a,10)||0;if(s>=p.size){s=p.size-1}if(m>=p.size){t.setHeader("Content-Range",`bytes */${p.size}`);t.statusCode=416;return t.end()}l["Content-Range"]=`bytes ${m}-${s}/${p.size}`;l["Content-Length"]=s-m+1;l["Accept-Ranges"]="bytes"}t.writeHead(o,l);e.createReadStream(a,n).pipe(t)}const c={".br":"br",".gz":"gzip"};function toHeaders(i,t,a){let e=c[i.slice(-3)];let p=m(i.slice(0,e&&-3))||"";if(p==="text/html")p+=";charset=utf-8";let l={"Content-Length":t.size,"Content-Type":p,"Last-Modified":t.mtime.toUTCString()};if(e)l["Content-Encoding"]=e;if(a)l["ETag"]=`W/"${t.size}-${t.mtime.getTime()}"`;return l}i.exports=function(i,t={}){i=o(i||".");let a=t.onNoMatch||is404;let e=t.setHeaders||noop;let p=t.extensions||["html","htm"];let l=t.gzip&&p.map((i=>`${i}.gz`)).concat("gz");let m=t.brotli&&p.map((i=>`${i}.br`)).concat("br");const c={};let r="/";let x=!!t.etag;let d=!!t.single;if(typeof t.single==="string"){let i=t.single.lastIndexOf(".");r+=!!~i?t.single.substring(0,i):t.single}let g=[];if(t.ignores!==false){g.push(/[/]([A-Za-z\s\d~$._-]+\.\w+){1,}$/);if(t.dotfiles)g.push(/\/\.\w/);else g.push(/\/\.well-known/);[].concat(t.ignores||[]).forEach((i=>{g.push(new RegExp(i,"i"))}))}let f=t.maxAge!=null&&`public,max-age=${t.maxAge}`;if(f&&t.immutable)f+=",immutable";else if(f&&t.maxAge===0)f+=",must-revalidate";if(!t.dev){s(i,((i,a,e)=>{if(/\.well-known[\\+\/]/.test(i)){}else if(!t.dotfiles&&/(^\.|[\\+|\/+]\.)/.test(i))return;let p=toHeaders(i,e,x);if(f)p["Cache-Control"]=f;c["/"+i.normalize().replace(/\\+/g,"/")]={abs:a,stats:e,headers:p}}))}let u=t.dev?viaLocal.bind(0,i,x):viaCache.bind(0,c);return function(i,t,o){let s=[""];let c=n(i).pathname;let f=i.headers["accept-encoding"]||"";if(l&&f.includes("gzip"))s.unshift(...l);if(m&&/(br|brotli)/i.test(f))s.unshift(...m);s.push(...p);if(c.indexOf("%")!==-1){try{c=decodeURI(c)}catch(i){}}let h=u(c,s)||d&&!isMatch(c,g)&&u(r,s);if(!h)return o?o():a(i,t);if(x&&i.headers["if-none-match"]===h.headers["ETag"]){t.writeHead(304);return t.end()}if(l||m){t.setHeader("Vary","Accept-Encoding")}e(t,c,h.stats);send(i,t,h.abs,h.stats,h.headers)}}},102:(i,t,a)=>{const{join:e,resolve:p}=a(17);const{readdirSync:l,statSync:o}=a(147);function totalist(i,t,a=""){i=p(".",i);let s=l(i);let n=0,m,c;for(;n<s.length;n++){m=e(i,s[n]);c=o(m);c.isDirectory()?totalist(m,t,e(a,s[n])):t(e(a,s[n]),m,c)}}t.totalist=totalist},147:i=>{"use strict";i.exports=require("fs")},17:i=>{"use strict";i.exports=require("path")},477:i=>{"use strict";i.exports=require("querystring")}};var t={};function __nccwpck_require__(a){var e=t[a];if(e!==undefined){return e.exports}var p=t[a]={exports:{}};var l=true;try{i[a](p,p.exports,__nccwpck_require__);l=false}finally{if(l)delete t[a]}return p.exports}if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var a=__nccwpck_require__(952);module.exports=a})();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"name":"sirv","author":{"name":"Luke Edwards","email":"luke@lukeed.com","url":"https://lukeed.com"},"version":"2.0.3","license":"MIT","types":"sirv.d.ts"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
declare namespace sirv {
|
|
2
|
+
import type { Stats } from 'fs';
|
|
3
|
+
import type { IncomingMessage, ServerResponse } from 'http';
|
|
4
|
+
|
|
5
|
+
type Arrayable<T> = T | T[];
|
|
6
|
+
export type NextHandler = () => void | Promise<void>;
|
|
7
|
+
export type RequestHandler = (req: IncomingMessage, res: ServerResponse, next?: NextHandler) => void;
|
|
8
|
+
|
|
9
|
+
export interface Options {
|
|
10
|
+
dev?: boolean;
|
|
11
|
+
etag?: boolean;
|
|
12
|
+
maxAge?: number;
|
|
13
|
+
immutable?: boolean;
|
|
14
|
+
single?: string | boolean;
|
|
15
|
+
ignores?: false | Arrayable<string | RegExp>;
|
|
16
|
+
extensions?: string[];
|
|
17
|
+
dotfiles?: boolean;
|
|
18
|
+
brotli?: boolean;
|
|
19
|
+
gzip?: boolean;
|
|
20
|
+
onNoMatch?: (req: IncomingMessage, res: ServerResponse) => void;
|
|
21
|
+
setHeaders?: (res: ServerResponse, pathname: string, stats: Stats) => void;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export default function(dir?: string, opts?: Options): RequestHandler;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export = sirv;
|
package/dist/cli/commands.d.ts
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export type
|
|
1
|
+
import type { RsbuildMode } from '..';
|
|
2
|
+
export type CommonOptions = {
|
|
3
|
+
config?: string;
|
|
4
|
+
};
|
|
5
|
+
export type InspectOptions = CommonOptions & {
|
|
3
6
|
env: RsbuildMode;
|
|
4
7
|
output: string;
|
|
5
8
|
verbose?: boolean;
|
|
6
9
|
};
|
|
7
|
-
export type DevOptions = {
|
|
10
|
+
export type DevOptions = CommonOptions & {
|
|
8
11
|
open?: boolean;
|
|
9
12
|
};
|
|
10
|
-
export declare function
|
|
13
|
+
export declare function init(options?: CommonOptions): Promise<import("@rsbuild/shared").RsbuildInstance<any>>;
|
|
14
|
+
export declare function runCli(): void;
|
package/dist/cli/commands.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
2
3
|
var __defProp = Object.defineProperty;
|
|
3
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
5
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
8
|
var __export = (target, all) => {
|
|
7
9
|
for (var name in all)
|
|
@@ -15,21 +17,45 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
15
17
|
}
|
|
16
18
|
return to;
|
|
17
19
|
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
18
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
29
|
var commands_exports = {};
|
|
20
30
|
__export(commands_exports, {
|
|
21
|
-
|
|
31
|
+
init: () => init,
|
|
32
|
+
runCli: () => runCli
|
|
22
33
|
});
|
|
23
34
|
module.exports = __toCommonJS(commands_exports);
|
|
24
35
|
var import_path = require("path");
|
|
25
36
|
var import_shared = require("@rsbuild/shared");
|
|
26
37
|
var import_commander = require("../../compiled/commander");
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
38
|
+
var import_config = require("./config");
|
|
39
|
+
let commonOpts = {};
|
|
40
|
+
async function init(options) {
|
|
41
|
+
if (options) {
|
|
42
|
+
commonOpts = options;
|
|
43
|
+
}
|
|
44
|
+
const config = await (0, import_config.loadConfig)(commonOpts.config);
|
|
45
|
+
const { createRsbuild } = await Promise.resolve().then(() => __toESM(require("../createRsbuild")));
|
|
46
|
+
return await createRsbuild({
|
|
47
|
+
rsbuildConfig: config,
|
|
48
|
+
provider: config.provider
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
function runCli() {
|
|
52
|
+
import_commander.program.name("rsbuild").usage("<command> [options]").version("0.0.26");
|
|
53
|
+
import_commander.program.command("dev").option(`--open`, "open the page in browser on startup").option(
|
|
54
|
+
"-c --config <config>",
|
|
55
|
+
"specify the configuration file, can be a relative or absolute path"
|
|
56
|
+
).description("starting the dev server").action(async (options) => {
|
|
32
57
|
try {
|
|
58
|
+
const rsbuild = await init(options);
|
|
33
59
|
await rsbuild.startDevServer({
|
|
34
60
|
open: options.open
|
|
35
61
|
});
|
|
@@ -39,8 +65,12 @@ function setupProgram(rsbuild) {
|
|
|
39
65
|
process.exit(1);
|
|
40
66
|
}
|
|
41
67
|
});
|
|
42
|
-
import_commander.program.command("build").
|
|
68
|
+
import_commander.program.command("build").option(
|
|
69
|
+
"-c --config <config>",
|
|
70
|
+
"specify the configuration file, can be a relative or absolute path"
|
|
71
|
+
).description("build the app for production").action(async (options) => {
|
|
43
72
|
try {
|
|
73
|
+
const rsbuild = await init(options);
|
|
44
74
|
await rsbuild.build();
|
|
45
75
|
} catch (err) {
|
|
46
76
|
import_shared.logger.error("Failed to build, please check logs.");
|
|
@@ -48,8 +78,12 @@ function setupProgram(rsbuild) {
|
|
|
48
78
|
process.exit(1);
|
|
49
79
|
}
|
|
50
80
|
});
|
|
51
|
-
import_commander.program.command("preview").
|
|
81
|
+
import_commander.program.command("preview").option(
|
|
82
|
+
"-c --config <config>",
|
|
83
|
+
"specify the configuration file, can be a relative or absolute path"
|
|
84
|
+
).description("preview the production build locally").action(async (options) => {
|
|
52
85
|
try {
|
|
86
|
+
const rsbuild = await init(options);
|
|
53
87
|
await rsbuild.preview();
|
|
54
88
|
} catch (err) {
|
|
55
89
|
import_shared.logger.error("Failed to start preview server, please check logs.");
|
|
@@ -57,8 +91,12 @@ function setupProgram(rsbuild) {
|
|
|
57
91
|
process.exit(1);
|
|
58
92
|
}
|
|
59
93
|
});
|
|
60
|
-
import_commander.program.command("inspect").description("inspect the Rspack and Rsbuild configs").option(`--env <env>`, "specify env mode", "development").option("--output <output>", "specify inspect content output path", "/").option("--verbose", "show full function definitions in output").
|
|
94
|
+
import_commander.program.command("inspect").description("inspect the Rspack and Rsbuild configs").option(`--env <env>`, "specify env mode", "development").option("--output <output>", "specify inspect content output path", "/").option("--verbose", "show full function definitions in output").option(
|
|
95
|
+
"-c --config <config>",
|
|
96
|
+
"specify the configuration file, can be a relative or absolute path"
|
|
97
|
+
).action(async (options) => {
|
|
61
98
|
try {
|
|
99
|
+
const rsbuild = await init(options);
|
|
62
100
|
await rsbuild.inspectConfig({
|
|
63
101
|
env: options.env,
|
|
64
102
|
verbose: options.verbose,
|
|
@@ -75,5 +113,6 @@ function setupProgram(rsbuild) {
|
|
|
75
113
|
}
|
|
76
114
|
// Annotate the CommonJS export names for ESM import in node:
|
|
77
115
|
0 && (module.exports = {
|
|
78
|
-
|
|
116
|
+
init,
|
|
117
|
+
runCli
|
|
79
118
|
});
|
package/dist/cli/config.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type RsbuildConfig as BaseRsbuildConfig } from '@rsbuild/shared';
|
|
2
2
|
export type RsbuildConfig = BaseRsbuildConfig & {
|
|
3
3
|
/**
|
|
4
4
|
* @private only for testing
|
|
@@ -6,4 +6,4 @@ export type RsbuildConfig = BaseRsbuildConfig & {
|
|
|
6
6
|
provider?: any;
|
|
7
7
|
};
|
|
8
8
|
export declare const defineConfig: (config: RsbuildConfig) => RsbuildConfig;
|
|
9
|
-
export declare function loadConfig(): Promise<ReturnType<typeof defineConfig>>;
|
|
9
|
+
export declare function loadConfig(customConfig?: string): Promise<ReturnType<typeof defineConfig>>;
|
package/dist/cli/config.js
CHANGED
|
@@ -33,11 +33,20 @@ __export(config_exports, {
|
|
|
33
33
|
});
|
|
34
34
|
module.exports = __toCommonJS(config_exports);
|
|
35
35
|
var import_fs = __toESM(require("fs"));
|
|
36
|
-
var import_jiti = __toESM(require("jiti"));
|
|
37
36
|
var import_path = require("path");
|
|
37
|
+
var import_shared = require("@rsbuild/shared");
|
|
38
38
|
var import_restart = require("../server/restart");
|
|
39
39
|
const defineConfig = (config) => config;
|
|
40
|
-
const resolveConfigPath = () => {
|
|
40
|
+
const resolveConfigPath = (customConfig) => {
|
|
41
|
+
const root = process.cwd();
|
|
42
|
+
if (customConfig) {
|
|
43
|
+
const customConfigPath = (0, import_path.isAbsolute)(customConfig) ? customConfig : (0, import_path.join)(root, customConfig);
|
|
44
|
+
if (import_fs.default.existsSync(customConfigPath)) {
|
|
45
|
+
return customConfigPath;
|
|
46
|
+
}
|
|
47
|
+
import_shared.logger.warn(`Cannot find config file: ${import_shared.color.dim(customConfigPath)}
|
|
48
|
+
`);
|
|
49
|
+
}
|
|
41
50
|
const CONFIG_FILES = [
|
|
42
51
|
"rsbuild.config.ts",
|
|
43
52
|
"rsbuild.config.js",
|
|
@@ -46,7 +55,6 @@ const resolveConfigPath = () => {
|
|
|
46
55
|
"rsbuild.config.mts",
|
|
47
56
|
"rsbuild.config.cts"
|
|
48
57
|
];
|
|
49
|
-
const root = process.cwd();
|
|
50
58
|
for (const file of CONFIG_FILES) {
|
|
51
59
|
const configFile = (0, import_path.join)(root, file);
|
|
52
60
|
if (import_fs.default.existsSync(configFile)) {
|
|
@@ -65,10 +73,11 @@ async function watchConfig(configFile) {
|
|
|
65
73
|
watcher.on("change", callback);
|
|
66
74
|
watcher.on("unlink", callback);
|
|
67
75
|
}
|
|
68
|
-
async function loadConfig() {
|
|
69
|
-
const configFile = resolveConfigPath();
|
|
76
|
+
async function loadConfig(customConfig) {
|
|
77
|
+
const configFile = resolveConfigPath(customConfig);
|
|
70
78
|
if (configFile) {
|
|
71
|
-
const
|
|
79
|
+
const { default: jiti } = await Promise.resolve().then(() => __toESM(require("../../compiled/jiti")));
|
|
80
|
+
const loadConfig2 = jiti(__filename, {
|
|
72
81
|
esmResolve: true,
|
|
73
82
|
// disable require cache to support restart CLI and read the new config
|
|
74
83
|
requireCache: false,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function prepareCli(): void;
|
|
@@ -16,26 +16,28 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
16
|
return to;
|
|
17
17
|
};
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var
|
|
20
|
-
__export(
|
|
21
|
-
|
|
19
|
+
var prepare_exports = {};
|
|
20
|
+
__export(prepare_exports, {
|
|
21
|
+
prepareCli: () => prepareCli
|
|
22
22
|
});
|
|
23
|
-
module.exports = __toCommonJS(
|
|
24
|
-
var
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
const rsbuild = await (0, import__.createRsbuild)({
|
|
30
|
-
rsbuildConfig: config,
|
|
31
|
-
provider: config.provider
|
|
32
|
-
});
|
|
33
|
-
if (!options.isRestart) {
|
|
34
|
-
(0, import_commands.setupProgram)(rsbuild);
|
|
23
|
+
module.exports = __toCommonJS(prepare_exports);
|
|
24
|
+
var import_rslog = require("@rsbuild/shared/rslog");
|
|
25
|
+
function initNodeEnv() {
|
|
26
|
+
if (!process.env.NODE_ENV) {
|
|
27
|
+
const command = process.argv[2];
|
|
28
|
+
process.env.NODE_ENV = ["build", "preview"].includes(command) ? "production" : "development";
|
|
35
29
|
}
|
|
36
|
-
|
|
30
|
+
}
|
|
31
|
+
function prepareCli() {
|
|
32
|
+
initNodeEnv();
|
|
33
|
+
const { npm_execpath } = process.env;
|
|
34
|
+
if (!npm_execpath || npm_execpath.includes("npx-cli.js")) {
|
|
35
|
+
console.log();
|
|
36
|
+
}
|
|
37
|
+
import_rslog.logger.greet(` ${`Rsbuild v${"0.0.26"}`}
|
|
38
|
+
`);
|
|
37
39
|
}
|
|
38
40
|
// Annotate the CommonJS export names for ESM import in node:
|
|
39
41
|
0 && (module.exports = {
|
|
40
|
-
|
|
42
|
+
prepareCli
|
|
41
43
|
});
|
package/dist/createRsbuild.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { type RsbuildInstance, type RsbuildProvider, type CreateRsbuildOptions } from '@rsbuild/shared';
|
|
2
|
-
import type { RsbuildConfig } from './
|
|
3
|
-
export declare const getCreateRsbuildDefaultOptions: () => Required<CreateRsbuildOptions>;
|
|
2
|
+
import type { RsbuildConfig } from './types';
|
|
4
3
|
export declare function createRsbuild<P extends ({
|
|
5
4
|
rsbuildConfig
|
|
6
5
|
}: {
|
package/dist/createRsbuild.js
CHANGED
|
@@ -28,8 +28,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
29
|
var createRsbuild_exports = {};
|
|
30
30
|
__export(createRsbuild_exports, {
|
|
31
|
-
createRsbuild: () => createRsbuild
|
|
32
|
-
getCreateRsbuildDefaultOptions: () => getCreateRsbuildDefaultOptions
|
|
31
|
+
createRsbuild: () => createRsbuild
|
|
33
32
|
});
|
|
34
33
|
module.exports = __toCommonJS(createRsbuild_exports);
|
|
35
34
|
var import_shared = require("@rsbuild/shared");
|
|
@@ -40,16 +39,12 @@ const getRspackProvider = async (rsbuildConfig) => {
|
|
|
40
39
|
rsbuildConfig
|
|
41
40
|
});
|
|
42
41
|
};
|
|
43
|
-
const getCreateRsbuildDefaultOptions = () => ({
|
|
44
|
-
cwd: process.cwd(),
|
|
45
|
-
target: ["web"],
|
|
46
|
-
configPath: null
|
|
47
|
-
});
|
|
48
42
|
async function createRsbuild(options) {
|
|
49
43
|
const { rsbuildConfig } = options;
|
|
50
44
|
const provider = options.provider ? options.provider({ rsbuildConfig }) : await getRspackProvider(rsbuildConfig);
|
|
51
45
|
const rsbuildOptions = {
|
|
52
|
-
|
|
46
|
+
cwd: process.cwd(),
|
|
47
|
+
target: ["web"],
|
|
53
48
|
...options
|
|
54
49
|
};
|
|
55
50
|
const pluginStore = (0, import_shared.createPluginStore)();
|
|
@@ -101,6 +96,5 @@ async function createRsbuild(options) {
|
|
|
101
96
|
}
|
|
102
97
|
// Annotate the CommonJS export names for ESM import in node:
|
|
103
98
|
0 && (module.exports = {
|
|
104
|
-
createRsbuild
|
|
105
|
-
getCreateRsbuildDefaultOptions
|
|
99
|
+
createRsbuild
|
|
106
100
|
});
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* The methods and types exported from this file are considered as
|
|
3
|
+
* the public API of @rsbuild/core.
|
|
4
|
+
*/
|
|
5
|
+
export { createRsbuild } from './createRsbuild';
|
|
2
6
|
export { mergeRsbuildConfig } from '@rsbuild/shared';
|
|
3
|
-
export { defineConfig } from './cli';
|
|
4
|
-
export type { Rspack
|
|
5
|
-
export type {
|
|
7
|
+
export { defineConfig } from './cli/config';
|
|
8
|
+
export type { Rspack } from './rspack-provider';
|
|
9
|
+
export type { RsbuildConfig, NormalizedConfig, RsbuildPlugin, RsbuildPluginAPI } from './types';
|
|
10
|
+
export type { Context as RsbuildContext, RsbuildMode, RsbuildEntry, RsbuildTarget, RsbuildInstance, CreateRsbuildOptions, InspectConfigOptions, OnExitFn, OnAfterBuildFn, OnAfterCreateCompilerFn, OnAfterStartDevServerFn, OnBeforeBuildFn, OnBeforeStartDevServerFn, OnBeforeCreateCompilerFn, OnDevCompileDoneFn, ModifyRsbuildConfigFn } from '@rsbuild/shared';
|
package/dist/index.js
CHANGED
|
@@ -19,18 +19,16 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
19
19
|
var src_exports = {};
|
|
20
20
|
__export(src_exports, {
|
|
21
21
|
createRsbuild: () => import_createRsbuild.createRsbuild,
|
|
22
|
-
defineConfig: () =>
|
|
23
|
-
getCreateRsbuildDefaultOptions: () => import_createRsbuild.getCreateRsbuildDefaultOptions,
|
|
22
|
+
defineConfig: () => import_config.defineConfig,
|
|
24
23
|
mergeRsbuildConfig: () => import_shared.mergeRsbuildConfig
|
|
25
24
|
});
|
|
26
25
|
module.exports = __toCommonJS(src_exports);
|
|
27
26
|
var import_createRsbuild = require("./createRsbuild");
|
|
28
27
|
var import_shared = require("@rsbuild/shared");
|
|
29
|
-
var
|
|
28
|
+
var import_config = require("./cli/config");
|
|
30
29
|
// Annotate the CommonJS export names for ESM import in node:
|
|
31
30
|
0 && (module.exports = {
|
|
32
31
|
createRsbuild,
|
|
33
32
|
defineConfig,
|
|
34
|
-
getCreateRsbuildDefaultOptions,
|
|
35
33
|
mergeRsbuildConfig
|
|
36
34
|
});
|
package/dist/plugins/asset.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { RsbuildPlugin } from '../types';
|
|
2
2
|
export declare function getRegExpForExts(exts: string[]): RegExp;
|
|
3
|
-
export declare const pluginAsset: () =>
|
|
3
|
+
export declare const pluginAsset: () => RsbuildPlugin;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare function pluginBundleAnalyzer():
|
|
1
|
+
import type { RsbuildPlugin } from '../types';
|
|
2
|
+
export declare function pluginBundleAnalyzer(): RsbuildPlugin;
|
package/dist/plugins/cache.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare const pluginCache: () =>
|
|
1
|
+
import type { RsbuildPlugin } from '../types';
|
|
2
|
+
export declare const pluginCache: () => RsbuildPlugin;
|
package/dist/plugins/cache.js
CHANGED
|
@@ -64,9 +64,6 @@ async function getBuildDependencies(context) {
|
|
|
64
64
|
if (await (0, import_shared2.isFileExists)(rootPackageJson)) {
|
|
65
65
|
buildDependencies.packageJson = [rootPackageJson];
|
|
66
66
|
}
|
|
67
|
-
if (context.configPath) {
|
|
68
|
-
buildDependencies.config = [context.configPath];
|
|
69
|
-
}
|
|
70
67
|
if (context.tsconfigPath) {
|
|
71
68
|
buildDependencies.tsconfig = [context.tsconfigPath];
|
|
72
69
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare const pluginCleanOutput: () =>
|
|
1
|
+
import type { RsbuildPlugin } from '../types';
|
|
2
|
+
export declare const pluginCleanOutput: () => RsbuildPlugin;
|
package/dist/plugins/define.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare const pluginDefine: () =>
|
|
1
|
+
import type { RsbuildPlugin } from '../types';
|
|
2
|
+
export declare const pluginDefine: () => RsbuildPlugin;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare const pluginDevtool: () =>
|
|
1
|
+
import type { RsbuildPlugin } from '../types';
|
|
2
|
+
export declare const pluginDevtool: () => RsbuildPlugin;
|
package/dist/plugins/entry.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { RsbuildPlugin } from '../
|
|
1
|
+
import type { RsbuildPlugin } from '../types';
|
|
2
2
|
export declare const pluginEntry: () => RsbuildPlugin;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare function pluginExternals():
|
|
1
|
+
import type { RsbuildPlugin } from '../types';
|
|
2
|
+
export declare function pluginExternals(): RsbuildPlugin;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { RsbuildPlugin } from '../types';
|
|
2
2
|
/** Filter source map and license files */
|
|
3
3
|
export declare const filterAsset: (asset: string) => boolean;
|
|
4
|
-
export declare const pluginFileSize: () =>
|
|
4
|
+
export declare const pluginFileSize: () => RsbuildPlugin;
|
package/dist/plugins/fileSize.js
CHANGED
|
@@ -144,8 +144,8 @@ const pluginFileSize = () => ({
|
|
|
144
144
|
try {
|
|
145
145
|
await printFileSizes(stats, api.context.distPath);
|
|
146
146
|
} catch (err) {
|
|
147
|
-
import_shared2.logger.
|
|
148
|
-
import_shared2.logger.
|
|
147
|
+
import_shared2.logger.warn("Failed to print file size.");
|
|
148
|
+
import_shared2.logger.warn(err);
|
|
149
149
|
}
|
|
150
150
|
}
|
|
151
151
|
});
|
package/dist/plugins/html.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type { MetaAttrs, HtmlConfig, MetaOptions, NormalizedConfig,
|
|
1
|
+
import type { MetaAttrs, HtmlConfig, MetaOptions, NormalizedConfig, SharedRsbuildPluginAPI, NormalizedOutputConfig } from '@rsbuild/shared';
|
|
2
|
+
import type { RsbuildPlugin } from '../types';
|
|
2
3
|
export declare function getTitle(entryName: string, config: NormalizedConfig): string;
|
|
3
4
|
export declare function getInject(entryName: string, config: NormalizedConfig): import("@rsbuild/shared").ScriptInject;
|
|
4
5
|
export declare function getTemplatePath(entryName: string, config: NormalizedConfig): string;
|
|
@@ -11,4 +12,4 @@ export declare function getMetaTags(entryName: string, config: {
|
|
|
11
12
|
output: NormalizedOutputConfig;
|
|
12
13
|
}): Promise<MetaAttrs[]>;
|
|
13
14
|
export declare const applyInjectTags: (api: SharedRsbuildPluginAPI) => void;
|
|
14
|
-
export declare const pluginHtml: () =>
|
|
15
|
+
export declare const pluginHtml: () => RsbuildPlugin;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare const pluginInlineChunk: () =>
|
|
1
|
+
import type { RsbuildPlugin } from '../types';
|
|
2
|
+
export declare const pluginInlineChunk: () => RsbuildPlugin;
|
package/dist/plugins/moment.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare const pluginMoment: () =>
|
|
1
|
+
import type { RsbuildPlugin } from '../types';
|
|
2
|
+
export declare const pluginMoment: () => RsbuildPlugin;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare const pluginNetworkPerformance: () =>
|
|
1
|
+
import type { RsbuildPlugin } from '../types';
|
|
2
|
+
export declare const pluginNetworkPerformance: () => RsbuildPlugin;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare const pluginNodeAddons: () =>
|
|
1
|
+
import type { RsbuildPlugin } from '../types';
|
|
2
|
+
export declare const pluginNodeAddons: () => RsbuildPlugin;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { RsbuildPlugin } from '../types';
|
|
2
2
|
/**
|
|
3
3
|
* Apply some configs of Rsbuild performance
|
|
4
4
|
*/
|
|
5
|
-
export declare const pluginPerformance: () =>
|
|
5
|
+
export declare const pluginPerformance: () => RsbuildPlugin;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare const pluginPreloadOrPrefetch: () =>
|
|
1
|
+
import type { RsbuildPlugin } from '../types';
|
|
2
|
+
export declare const pluginPreloadOrPrefetch: () => RsbuildPlugin;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { RsbuildPlugin } from '../types';
|
|
2
2
|
/** Expect to match path just like "./node_modules/react-router/" */
|
|
3
3
|
export declare const createDependenciesRegExp: (...dependencies: (string | RegExp)[]) => RegExp;
|
|
4
|
-
export declare function pluginSplitChunks():
|
|
4
|
+
export declare function pluginSplitChunks(): RsbuildPlugin;
|