@rsbuild/webpack 1.0.0 → 1.0.1-beta.1
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/README.md +23 -2
- package/dist/index.cjs +2582 -0
- package/dist/index.js +2609 -17
- package/dist-types/build.d.ts +3 -0
- package/dist-types/createCompiler.d.ts +12 -0
- package/dist-types/index.d.ts +2 -0
- package/dist-types/initConfigs.d.ts +11 -0
- package/dist-types/inspectConfig.d.ts +7 -0
- package/dist-types/package.json +1 -0
- package/dist-types/plugin.d.ts +5 -0
- package/dist-types/progress/ProgressPlugin.d.ts +13 -0
- package/{dist/webpackPlugins/ProgressPlugin → dist-types/progress}/helpers/bar.d.ts +2 -2
- package/dist-types/progress/helpers/bus.d.ts +18 -0
- package/dist-types/progress/helpers/index.d.ts +4 -0
- package/dist-types/progress/helpers/log.d.ts +8 -0
- package/dist-types/progress/helpers/nonTty.d.ts +9 -0
- package/{dist/webpackPlugins/ProgressPlugin → dist-types/progress}/helpers/percentage.d.ts +1 -1
- package/dist-types/progress/helpers/types.d.ts +24 -0
- package/{dist/webpackPlugins/ProgressPlugin → dist-types/progress}/helpers/utils.d.ts +1 -1
- package/dist-types/provider.d.ts +2 -0
- package/dist-types/shared.d.ts +17 -0
- package/dist-types/types.d.ts +3 -0
- package/dist-types/webpackConfig.d.ts +8 -0
- package/package.json +21 -50
- package/static/ModuleFilenameHelpers.js +1 -1
- package/compiled/ansi-escapes/index.d.ts +0 -248
- package/compiled/ansi-escapes/index.js +0 -1
- package/compiled/ansi-escapes/license +0 -9
- package/compiled/ansi-escapes/package.json +0 -1
- package/compiled/ansi-escapes/type-fest/index.d.ts +0 -2
- package/compiled/babel-plugin-lodash/index.d.ts +0 -1
- package/compiled/babel-plugin-lodash/index.js +0 -1
- package/compiled/babel-plugin-lodash/license +0 -44
- package/compiled/babel-plugin-lodash/package.json +0 -1
- package/compiled/babel-plugin-transform-react-remove-prop-types/index.d.ts +0 -1
- package/compiled/babel-plugin-transform-react-remove-prop-types/index.js +0 -1
- package/compiled/babel-plugin-transform-react-remove-prop-types/license +0 -22
- package/compiled/babel-plugin-transform-react-remove-prop-types/package.json +0 -1
- package/compiled/cli-truncate/index.d.ts +0 -96
- package/compiled/cli-truncate/index.js +0 -1
- package/compiled/cli-truncate/license +0 -9
- package/compiled/cli-truncate/package.json +0 -1
- package/compiled/copy-webpack-plugin/index.d.ts +0 -1
- package/compiled/copy-webpack-plugin/index.js +0 -22
- package/compiled/copy-webpack-plugin/license +0 -20
- package/compiled/copy-webpack-plugin/package.json +0 -1
- package/compiled/patch-console/build/index.d.ts +0 -4
- package/compiled/patch-console/index.js +0 -1
- package/compiled/patch-console/package.json +0 -1
- package/compiled/schema-utils3/index.d.ts +0 -1
- package/compiled/schema-utils3/index.js +0 -3
- package/compiled/schema-utils3/license +0 -20
- package/compiled/schema-utils3/package.json +0 -1
- package/compiled/tapable/index.js +0 -1
- package/compiled/tapable/license +0 -21
- package/compiled/tapable/package.json +0 -1
- package/compiled/tapable/tapable.d.ts +0 -116
- package/compiled/webpack-sources/index.d.ts +0 -1
- package/compiled/webpack-sources/index.js +0 -1
- package/compiled/webpack-sources/license +0 -21
- package/compiled/webpack-sources/package.json +0 -1
- package/dist/config/defaults.d.ts +0 -3
- package/dist/config/defaults.js +0 -47
- package/dist/config/normalize.d.ts +0 -7
- package/dist/config/normalize.js +0 -33
- package/dist/core/build.d.ts +0 -20
- package/dist/core/build.js +0 -80
- package/dist/core/createCompiler.d.ts +0 -14
- package/dist/core/createCompiler.js +0 -88
- package/dist/core/createContext.d.ts +0 -13
- package/dist/core/createContext.js +0 -58
- package/dist/core/devMiddleware.d.ts +0 -3
- package/dist/core/devMiddleware.js +0 -73
- package/dist/core/initConfigs.d.ts +0 -14
- package/dist/core/initConfigs.js +0 -79
- package/dist/core/initHooks.d.ts +0 -19
- package/dist/core/initHooks.js +0 -44
- package/dist/core/initPlugins.d.ts +0 -9
- package/dist/core/initPlugins.js +0 -86
- package/dist/core/inspectConfig.d.ts +0 -20
- package/dist/core/inspectConfig.js +0 -81
- package/dist/core/webpackConfig.d.ts +0 -9
- package/dist/core/webpackConfig.js +0 -164
- package/dist/exports/webpack.d.ts +0 -2
- package/dist/exports/webpack.js +0 -35
- package/dist/index.d.ts +0 -6
- package/dist/plugins/babel.d.ts +0 -3
- package/dist/plugins/babel.js +0 -169
- package/dist/plugins/basic.d.ts +0 -5
- package/dist/plugins/basic.js +0 -58
- package/dist/plugins/copy.d.ts +0 -2
- package/dist/plugins/copy.js +0 -69
- package/dist/plugins/css.d.ts +0 -23
- package/dist/plugins/css.js +0 -121
- package/dist/plugins/hmr.d.ts +0 -2
- package/dist/plugins/hmr.js +0 -41
- package/dist/plugins/less.d.ts +0 -6
- package/dist/plugins/less.js +0 -65
- package/dist/plugins/minimize.d.ts +0 -2
- package/dist/plugins/minimize.js +0 -64
- package/dist/plugins/output.d.ts +0 -2
- package/dist/plugins/output.js +0 -66
- package/dist/plugins/progress.d.ts +0 -2
- package/dist/plugins/progress.js +0 -58
- package/dist/plugins/react.d.ts +0 -2
- package/dist/plugins/react.js +0 -97
- package/dist/plugins/resolve.d.ts +0 -2
- package/dist/plugins/resolve.js +0 -86
- package/dist/plugins/sass.d.ts +0 -2
- package/dist/plugins/sass.js +0 -76
- package/dist/plugins/tsLoader.d.ts +0 -2
- package/dist/plugins/tsLoader.js +0 -105
- package/dist/provider.d.ts +0 -9
- package/dist/provider.js +0 -108
- package/dist/shared/fs.d.ts +0 -1
- package/dist/shared/fs.js +0 -48
- package/dist/shared/index.d.ts +0 -1
- package/dist/shared/index.js +0 -22
- package/dist/shared/plugin.d.ts +0 -3
- package/dist/shared/plugin.js +0 -78
- package/dist/types/config/index.d.ts +0 -26
- package/dist/types/config/index.js +0 -22
- package/dist/types/config/tools.d.ts +0 -51
- package/dist/types/config/tools.js +0 -16
- package/dist/types/context.d.ts +0 -17
- package/dist/types/context.js +0 -16
- package/dist/types/index.d.ts +0 -4
- package/dist/types/index.js +0 -28
- package/dist/types/plugin.d.ts +0 -6
- package/dist/types/plugin.js +0 -16
- package/dist/types/thirdParty/css.d.ts +0 -7
- package/dist/types/thirdParty/css.js +0 -16
- package/dist/types/thirdParty/index.d.ts +0 -8
- package/dist/types/thirdParty/index.js +0 -16
- package/dist/webpackPlugins/ProgressPlugin/ProgressPlugin.d.ts +0 -13
- package/dist/webpackPlugins/ProgressPlugin/ProgressPlugin.js +0 -104
- package/dist/webpackPlugins/ProgressPlugin/helpers/bar.js +0 -142
- package/dist/webpackPlugins/ProgressPlugin/helpers/bus.d.ts +0 -17
- package/dist/webpackPlugins/ProgressPlugin/helpers/bus.js +0 -105
- package/dist/webpackPlugins/ProgressPlugin/helpers/index.d.ts +0 -4
- package/dist/webpackPlugins/ProgressPlugin/helpers/index.js +0 -28
- package/dist/webpackPlugins/ProgressPlugin/helpers/log.d.ts +0 -9
- package/dist/webpackPlugins/ProgressPlugin/helpers/log.js +0 -62
- package/dist/webpackPlugins/ProgressPlugin/helpers/nonTty.d.ts +0 -15
- package/dist/webpackPlugins/ProgressPlugin/helpers/nonTty.js +0 -56
- package/dist/webpackPlugins/ProgressPlugin/helpers/percentage.js +0 -52
- package/dist/webpackPlugins/ProgressPlugin/helpers/type.d.ts +0 -23
- package/dist/webpackPlugins/ProgressPlugin/helpers/type.js +0 -16
- package/dist/webpackPlugins/ProgressPlugin/helpers/utils.js +0 -30
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(()=>{"use strict";var e={410:(e,t,n)=>{const o=n(506);const r=n(507);class AsyncParallelBailHookCodeFactory extends r{content({onError:e,onResult:t,onDone:n}){let o="";o+=`var _results = new Array(${this.options.taps.length});\n`;o+="var _checkDone = function() {\n";o+="for(var i = 0; i < _results.length; i++) {\n";o+="var item = _results[i];\n";o+="if(item === undefined) return false;\n";o+="if(item.result !== undefined) {\n";o+=t("item.result");o+="return true;\n";o+="}\n";o+="if(item.error) {\n";o+=e("item.error");o+="return true;\n";o+="}\n";o+="}\n";o+="return false;\n";o+="}\n";o+=this.callTapsParallel({onError:(e,t,n,o)=>{let r="";r+=`if(${e} < _results.length && ((_results.length = ${e+1}), (_results[${e}] = { error: ${t} }), _checkDone())) {\n`;r+=o(true);r+="} else {\n";r+=n();r+="}\n";return r},onResult:(e,t,n,o)=>{let r="";r+=`if(${e} < _results.length && (${t} !== undefined && (_results.length = ${e+1}), (_results[${e}] = { result: ${t} }), _checkDone())) {\n`;r+=o(true);r+="} else {\n";r+=n();r+="}\n";return r},onTap:(e,t,n,o)=>{let r="";if(e>0){r+=`if(${e} >= _results.length) {\n`;r+=n();r+="} else {\n"}r+=t();if(e>0)r+="}\n";return r},onDone:n});return o}}const s=new AsyncParallelBailHookCodeFactory;const COMPILE=function(e){s.setup(this,e);return s.create(e)};function AsyncParallelBailHook(e=[],t=undefined){const n=new o(e,t);n.constructor=AsyncParallelBailHook;n.compile=COMPILE;n._call=undefined;n.call=undefined;return n}AsyncParallelBailHook.prototype=null;e.exports=AsyncParallelBailHook},598:(e,t,n)=>{const o=n(506);const r=n(507);class AsyncParallelHookCodeFactory extends r{content({onError:e,onDone:t}){return this.callTapsParallel({onError:(t,n,o,r)=>e(n)+r(true),onDone:t})}}const s=new AsyncParallelHookCodeFactory;const COMPILE=function(e){s.setup(this,e);return s.create(e)};function AsyncParallelHook(e=[],t=undefined){const n=new o(e,t);n.constructor=AsyncParallelHook;n.compile=COMPILE;n._call=undefined;n.call=undefined;return n}AsyncParallelHook.prototype=null;e.exports=AsyncParallelHook},178:(e,t,n)=>{const o=n(506);const r=n(507);class AsyncSeriesBailHookCodeFactory extends r{content({onError:e,onResult:t,resultReturns:n,onDone:o}){return this.callTapsSeries({onError:(t,n,o,r)=>e(n)+r(true),onResult:(e,n,o)=>`if(${n} !== undefined) {\n${t(n)}\n} else {\n${o()}}\n`,resultReturns:n,onDone:o})}}const s=new AsyncSeriesBailHookCodeFactory;const COMPILE=function(e){s.setup(this,e);return s.create(e)};function AsyncSeriesBailHook(e=[],t=undefined){const n=new o(e,t);n.constructor=AsyncSeriesBailHook;n.compile=COMPILE;n._call=undefined;n.call=undefined;return n}AsyncSeriesBailHook.prototype=null;e.exports=AsyncSeriesBailHook},97:(e,t,n)=>{const o=n(506);const r=n(507);class AsyncSeriesHookCodeFactory extends r{content({onError:e,onDone:t}){return this.callTapsSeries({onError:(t,n,o,r)=>e(n)+r(true),onDone:t})}}const s=new AsyncSeriesHookCodeFactory;const COMPILE=function(e){s.setup(this,e);return s.create(e)};function AsyncSeriesHook(e=[],t=undefined){const n=new o(e,t);n.constructor=AsyncSeriesHook;n.compile=COMPILE;n._call=undefined;n.call=undefined;return n}AsyncSeriesHook.prototype=null;e.exports=AsyncSeriesHook},243:(e,t,n)=>{const o=n(506);const r=n(507);class AsyncSeriesLoopHookCodeFactory extends r{content({onError:e,onDone:t}){return this.callTapsLooping({onError:(t,n,o,r)=>e(n)+r(true),onDone:t})}}const s=new AsyncSeriesLoopHookCodeFactory;const COMPILE=function(e){s.setup(this,e);return s.create(e)};function AsyncSeriesLoopHook(e=[],t=undefined){const n=new o(e,t);n.constructor=AsyncSeriesLoopHook;n.compile=COMPILE;n._call=undefined;n.call=undefined;return n}AsyncSeriesLoopHook.prototype=null;e.exports=AsyncSeriesLoopHook},969:(e,t,n)=>{const o=n(506);const r=n(507);class AsyncSeriesWaterfallHookCodeFactory extends r{content({onError:e,onResult:t,onDone:n}){return this.callTapsSeries({onError:(t,n,o,r)=>e(n)+r(true),onResult:(e,t,n)=>{let o="";o+=`if(${t} !== undefined) {\n`;o+=`${this._args[0]} = ${t};\n`;o+=`}\n`;o+=n();return o},onDone:()=>t(this._args[0])})}}const s=new AsyncSeriesWaterfallHookCodeFactory;const COMPILE=function(e){s.setup(this,e);return s.create(e)};function AsyncSeriesWaterfallHook(e=[],t=undefined){if(e.length<1)throw new Error("Waterfall hooks must have at least one argument");const n=new o(e,t);n.constructor=AsyncSeriesWaterfallHook;n.compile=COMPILE;n._call=undefined;n.call=undefined;return n}AsyncSeriesWaterfallHook.prototype=null;e.exports=AsyncSeriesWaterfallHook},506:(e,t,n)=>{const o=n(837);const r=o.deprecate((()=>{}),"Hook.context is deprecated and will be removed");const CALL_DELEGATE=function(...e){this.call=this._createCall("sync");return this.call(...e)};const CALL_ASYNC_DELEGATE=function(...e){this.callAsync=this._createCall("async");return this.callAsync(...e)};const PROMISE_DELEGATE=function(...e){this.promise=this._createCall("promise");return this.promise(...e)};class Hook{constructor(e=[],t=undefined){this._args=e;this.name=t;this.taps=[];this.interceptors=[];this._call=CALL_DELEGATE;this.call=CALL_DELEGATE;this._callAsync=CALL_ASYNC_DELEGATE;this.callAsync=CALL_ASYNC_DELEGATE;this._promise=PROMISE_DELEGATE;this.promise=PROMISE_DELEGATE;this._x=undefined;this.compile=this.compile;this.tap=this.tap;this.tapAsync=this.tapAsync;this.tapPromise=this.tapPromise}compile(e){throw new Error("Abstract: should be overridden")}_createCall(e){return this.compile({taps:this.taps,interceptors:this.interceptors,args:this._args,type:e})}_tap(e,t,n){if(typeof t==="string"){t={name:t.trim()}}else if(typeof t!=="object"||t===null){throw new Error("Invalid tap options")}if(typeof t.name!=="string"||t.name===""){throw new Error("Missing name for tap")}if(typeof t.context!=="undefined"){r()}t=Object.assign({type:e,fn:n},t);t=this._runRegisterInterceptors(t);this._insert(t)}tap(e,t){this._tap("sync",e,t)}tapAsync(e,t){this._tap("async",e,t)}tapPromise(e,t){this._tap("promise",e,t)}_runRegisterInterceptors(e){for(const t of this.interceptors){if(t.register){const n=t.register(e);if(n!==undefined){e=n}}}return e}withOptions(e){const mergeOptions=t=>Object.assign({},e,typeof t==="string"?{name:t}:t);return{name:this.name,tap:(e,t)=>this.tap(mergeOptions(e),t),tapAsync:(e,t)=>this.tapAsync(mergeOptions(e),t),tapPromise:(e,t)=>this.tapPromise(mergeOptions(e),t),intercept:e=>this.intercept(e),isUsed:()=>this.isUsed(),withOptions:e=>this.withOptions(mergeOptions(e))}}isUsed(){return this.taps.length>0||this.interceptors.length>0}intercept(e){this._resetCompilation();this.interceptors.push(Object.assign({},e));if(e.register){for(let t=0;t<this.taps.length;t++){this.taps[t]=e.register(this.taps[t])}}}_resetCompilation(){this.call=this._call;this.callAsync=this._callAsync;this.promise=this._promise}_insert(e){this._resetCompilation();let t;if(typeof e.before==="string"){t=new Set([e.before])}else if(Array.isArray(e.before)){t=new Set(e.before)}let n=0;if(typeof e.stage==="number"){n=e.stage}let o=this.taps.length;while(o>0){o--;const e=this.taps[o];this.taps[o+1]=e;const r=e.stage||0;if(t){if(t.has(e.name)){t.delete(e.name);continue}if(t.size>0){continue}}if(r>n){continue}o++;break}this.taps[o]=e}}Object.setPrototypeOf(Hook.prototype,null);e.exports=Hook},507:e=>{class HookCodeFactory{constructor(e){this.config=e;this.options=undefined;this._args=undefined}create(e){this.init(e);let t;switch(this.options.type){case"sync":t=new Function(this.args(),'"use strict";\n'+this.header()+this.contentWithInterceptors({onError:e=>`throw ${e};\n`,onResult:e=>`return ${e};\n`,resultReturns:true,onDone:()=>"",rethrowIfPossible:true}));break;case"async":t=new Function(this.args({after:"_callback"}),'"use strict";\n'+this.header()+this.contentWithInterceptors({onError:e=>`_callback(${e});\n`,onResult:e=>`_callback(null, ${e});\n`,onDone:()=>"_callback();\n"}));break;case"promise":let e=false;const n=this.contentWithInterceptors({onError:t=>{e=true;return`_error(${t});\n`},onResult:e=>`_resolve(${e});\n`,onDone:()=>"_resolve();\n"});let o="";o+='"use strict";\n';o+=this.header();o+="return new Promise((function(_resolve, _reject) {\n";if(e){o+="var _sync = true;\n";o+="function _error(_err) {\n";o+="if(_sync)\n";o+="_resolve(Promise.resolve().then((function() { throw _err; })));\n";o+="else\n";o+="_reject(_err);\n";o+="};\n"}o+=n;if(e){o+="_sync = false;\n"}o+="}));\n";t=new Function(this.args(),o);break}this.deinit();return t}setup(e,t){e._x=t.taps.map((e=>e.fn))}init(e){this.options=e;this._args=e.args.slice()}deinit(){this.options=undefined;this._args=undefined}contentWithInterceptors(e){if(this.options.interceptors.length>0){const t=e.onError;const n=e.onResult;const o=e.onDone;let r="";for(let e=0;e<this.options.interceptors.length;e++){const t=this.options.interceptors[e];if(t.call){r+=`${this.getInterceptor(e)}.call(${this.args({before:t.context?"_context":undefined})});\n`}}r+=this.content(Object.assign(e,{onError:t&&(e=>{let n="";for(let t=0;t<this.options.interceptors.length;t++){const o=this.options.interceptors[t];if(o.error){n+=`${this.getInterceptor(t)}.error(${e});\n`}}n+=t(e);return n}),onResult:n&&(e=>{let t="";for(let n=0;n<this.options.interceptors.length;n++){const o=this.options.interceptors[n];if(o.result){t+=`${this.getInterceptor(n)}.result(${e});\n`}}t+=n(e);return t}),onDone:o&&(()=>{let e="";for(let t=0;t<this.options.interceptors.length;t++){const n=this.options.interceptors[t];if(n.done){e+=`${this.getInterceptor(t)}.done();\n`}}e+=o();return e})}));return r}else{return this.content(e)}}header(){let e="";if(this.needContext()){e+="var _context = {};\n"}else{e+="var _context;\n"}e+="var _x = this._x;\n";if(this.options.interceptors.length>0){e+="var _taps = this.taps;\n";e+="var _interceptors = this.interceptors;\n"}return e}needContext(){for(const e of this.options.taps)if(e.context)return true;return false}callTap(e,{onError:t,onResult:n,onDone:o,rethrowIfPossible:r}){let s="";let i=false;for(let t=0;t<this.options.interceptors.length;t++){const n=this.options.interceptors[t];if(n.tap){if(!i){s+=`var _tap${e} = ${this.getTap(e)};\n`;i=true}s+=`${this.getInterceptor(t)}.tap(${n.context?"_context, ":""}_tap${e});\n`}}s+=`var _fn${e} = ${this.getTapFn(e)};\n`;const c=this.options.taps[e];switch(c.type){case"sync":if(!r){s+=`var _hasError${e} = false;\n`;s+="try {\n"}if(n){s+=`var _result${e} = _fn${e}(${this.args({before:c.context?"_context":undefined})});\n`}else{s+=`_fn${e}(${this.args({before:c.context?"_context":undefined})});\n`}if(!r){s+="} catch(_err) {\n";s+=`_hasError${e} = true;\n`;s+=t("_err");s+="}\n";s+=`if(!_hasError${e}) {\n`}if(n){s+=n(`_result${e}`)}if(o){s+=o()}if(!r){s+="}\n"}break;case"async":let i="";if(n)i+=`(function(_err${e}, _result${e}) {\n`;else i+=`(function(_err${e}) {\n`;i+=`if(_err${e}) {\n`;i+=t(`_err${e}`);i+="} else {\n";if(n){i+=n(`_result${e}`)}if(o){i+=o()}i+="}\n";i+="})";s+=`_fn${e}(${this.args({before:c.context?"_context":undefined,after:i})});\n`;break;case"promise":s+=`var _hasResult${e} = false;\n`;s+=`var _promise${e} = _fn${e}(${this.args({before:c.context?"_context":undefined})});\n`;s+=`if (!_promise${e} || !_promise${e}.then)\n`;s+=` throw new Error('Tap function (tapPromise) did not return promise (returned ' + _promise${e} + ')');\n`;s+=`_promise${e}.then((function(_result${e}) {\n`;s+=`_hasResult${e} = true;\n`;if(n){s+=n(`_result${e}`)}if(o){s+=o()}s+=`}), function(_err${e}) {\n`;s+=`if(_hasResult${e}) throw _err${e};\n`;s+=t(`_err${e}`);s+="});\n";break}return s}callTapsSeries({onError:e,onResult:t,resultReturns:n,onDone:o,doneReturns:r,rethrowIfPossible:s}){if(this.options.taps.length===0)return o();const i=this.options.taps.findIndex((e=>e.type!=="sync"));const c=n||r;let a="";let l=o;let p=0;for(let n=this.options.taps.length-1;n>=0;n--){const r=n;const u=l!==o&&(this.options.taps[r].type!=="sync"||p++>20);if(u){p=0;a+=`function _next${r}() {\n`;a+=l();a+=`}\n`;l=()=>`${c?"return ":""}_next${r}();\n`}const f=l;const doneBreak=e=>{if(e)return"";return o()};const h=this.callTap(r,{onError:t=>e(r,t,f,doneBreak),onResult:t&&(e=>t(r,e,f,doneBreak)),onDone:!t&&f,rethrowIfPossible:s&&(i<0||r<i)});l=()=>h}a+=l();return a}callTapsLooping({onError:e,onDone:t,rethrowIfPossible:n}){if(this.options.taps.length===0)return t();const o=this.options.taps.every((e=>e.type==="sync"));let r="";if(!o){r+="var _looper = (function() {\n";r+="var _loopAsync = false;\n"}r+="var _loop;\n";r+="do {\n";r+="_loop = false;\n";for(let e=0;e<this.options.interceptors.length;e++){const t=this.options.interceptors[e];if(t.loop){r+=`${this.getInterceptor(e)}.loop(${this.args({before:t.context?"_context":undefined})});\n`}}r+=this.callTapsSeries({onError:e,onResult:(e,t,n,r)=>{let s="";s+=`if(${t} !== undefined) {\n`;s+="_loop = true;\n";if(!o)s+="if(_loopAsync) _looper();\n";s+=r(true);s+=`} else {\n`;s+=n();s+=`}\n`;return s},onDone:t&&(()=>{let e="";e+="if(!_loop) {\n";e+=t();e+="}\n";return e}),rethrowIfPossible:n&&o});r+="} while(_loop);\n";if(!o){r+="_loopAsync = true;\n";r+="});\n";r+="_looper();\n"}return r}callTapsParallel({onError:e,onResult:t,onDone:n,rethrowIfPossible:o,onTap:r=((e,t)=>t())}){if(this.options.taps.length<=1){return this.callTapsSeries({onError:e,onResult:t,onDone:n,rethrowIfPossible:o})}let s="";s+="do {\n";s+=`var _counter = ${this.options.taps.length};\n`;if(n){s+="var _done = (function() {\n";s+=n();s+="});\n"}for(let i=0;i<this.options.taps.length;i++){const done=()=>{if(n)return"if(--_counter === 0) _done();\n";else return"--_counter;"};const doneBreak=e=>{if(e||!n)return"_counter = 0;\n";else return"_counter = 0;\n_done();\n"};s+="if(_counter <= 0) break;\n";s+=r(i,(()=>this.callTap(i,{onError:t=>{let n="";n+="if(_counter > 0) {\n";n+=e(i,t,done,doneBreak);n+="}\n";return n},onResult:t&&(e=>{let n="";n+="if(_counter > 0) {\n";n+=t(i,e,done,doneBreak);n+="}\n";return n}),onDone:!t&&(()=>done()),rethrowIfPossible:o})),done,doneBreak)}s+="} while(false);\n";return s}args({before:e,after:t}={}){let n=this._args;if(e)n=[e].concat(n);if(t)n=n.concat(t);if(n.length===0){return""}else{return n.join(", ")}}getTapFn(e){return`_x[${e}]`}getTap(e){return`_taps[${e}]`}getInterceptor(e){return`_interceptors[${e}]`}}e.exports=HookCodeFactory},876:(e,t,n)=>{const o=n(837);const defaultFactory=(e,t)=>t;class HookMap{constructor(e,t=undefined){this._map=new Map;this.name=t;this._factory=e;this._interceptors=[]}get(e){return this._map.get(e)}for(e){const t=this.get(e);if(t!==undefined){return t}let n=this._factory(e);const o=this._interceptors;for(let t=0;t<o.length;t++){n=o[t].factory(e,n)}this._map.set(e,n);return n}intercept(e){this._interceptors.push(Object.assign({factory:defaultFactory},e))}}HookMap.prototype.tap=o.deprecate((function(e,t,n){return this.for(e).tap(t,n)}),"HookMap#tap(key,…) is deprecated. Use HookMap#for(key).tap(…) instead.");HookMap.prototype.tapAsync=o.deprecate((function(e,t,n){return this.for(e).tapAsync(t,n)}),"HookMap#tapAsync(key,…) is deprecated. Use HookMap#for(key).tapAsync(…) instead.");HookMap.prototype.tapPromise=o.deprecate((function(e,t,n){return this.for(e).tapPromise(t,n)}),"HookMap#tapPromise(key,…) is deprecated. Use HookMap#for(key).tapPromise(…) instead.");e.exports=HookMap},274:(e,t,n)=>{const o=n(506);class MultiHook{constructor(e,t=undefined){this.hooks=e;this.name=t}tap(e,t){for(const n of this.hooks){n.tap(e,t)}}tapAsync(e,t){for(const n of this.hooks){n.tapAsync(e,t)}}tapPromise(e,t){for(const n of this.hooks){n.tapPromise(e,t)}}isUsed(){for(const e of this.hooks){if(e.isUsed())return true}return false}intercept(e){for(const t of this.hooks){t.intercept(e)}}withOptions(e){return new MultiHook(this.hooks.map((t=>t.withOptions(e))),this.name)}}e.exports=MultiHook},130:(e,t,n)=>{const o=n(506);const r=n(507);class SyncBailHookCodeFactory extends r{content({onError:e,onResult:t,resultReturns:n,onDone:o,rethrowIfPossible:r}){return this.callTapsSeries({onError:(t,n)=>e(n),onResult:(e,n,o)=>`if(${n} !== undefined) {\n${t(n)};\n} else {\n${o()}}\n`,resultReturns:n,onDone:o,rethrowIfPossible:r})}}const s=new SyncBailHookCodeFactory;const TAP_ASYNC=()=>{throw new Error("tapAsync is not supported on a SyncBailHook")};const TAP_PROMISE=()=>{throw new Error("tapPromise is not supported on a SyncBailHook")};const COMPILE=function(e){s.setup(this,e);return s.create(e)};function SyncBailHook(e=[],t=undefined){const n=new o(e,t);n.constructor=SyncBailHook;n.tapAsync=TAP_ASYNC;n.tapPromise=TAP_PROMISE;n.compile=COMPILE;return n}SyncBailHook.prototype=null;e.exports=SyncBailHook},856:(e,t,n)=>{const o=n(506);const r=n(507);class SyncHookCodeFactory extends r{content({onError:e,onDone:t,rethrowIfPossible:n}){return this.callTapsSeries({onError:(t,n)=>e(n),onDone:t,rethrowIfPossible:n})}}const s=new SyncHookCodeFactory;const TAP_ASYNC=()=>{throw new Error("tapAsync is not supported on a SyncHook")};const TAP_PROMISE=()=>{throw new Error("tapPromise is not supported on a SyncHook")};const COMPILE=function(e){s.setup(this,e);return s.create(e)};function SyncHook(e=[],t=undefined){const n=new o(e,t);n.constructor=SyncHook;n.tapAsync=TAP_ASYNC;n.tapPromise=TAP_PROMISE;n.compile=COMPILE;return n}SyncHook.prototype=null;e.exports=SyncHook},925:(e,t,n)=>{const o=n(506);const r=n(507);class SyncLoopHookCodeFactory extends r{content({onError:e,onDone:t,rethrowIfPossible:n}){return this.callTapsLooping({onError:(t,n)=>e(n),onDone:t,rethrowIfPossible:n})}}const s=new SyncLoopHookCodeFactory;const TAP_ASYNC=()=>{throw new Error("tapAsync is not supported on a SyncLoopHook")};const TAP_PROMISE=()=>{throw new Error("tapPromise is not supported on a SyncLoopHook")};const COMPILE=function(e){s.setup(this,e);return s.create(e)};function SyncLoopHook(e=[],t=undefined){const n=new o(e,t);n.constructor=SyncLoopHook;n.tapAsync=TAP_ASYNC;n.tapPromise=TAP_PROMISE;n.compile=COMPILE;return n}SyncLoopHook.prototype=null;e.exports=SyncLoopHook},844:(e,t,n)=>{const o=n(506);const r=n(507);class SyncWaterfallHookCodeFactory extends r{content({onError:e,onResult:t,resultReturns:n,rethrowIfPossible:o}){return this.callTapsSeries({onError:(t,n)=>e(n),onResult:(e,t,n)=>{let o="";o+=`if(${t} !== undefined) {\n`;o+=`${this._args[0]} = ${t};\n`;o+=`}\n`;o+=n();return o},onDone:()=>t(this._args[0]),doneReturns:n,rethrowIfPossible:o})}}const s=new SyncWaterfallHookCodeFactory;const TAP_ASYNC=()=>{throw new Error("tapAsync is not supported on a SyncWaterfallHook")};const TAP_PROMISE=()=>{throw new Error("tapPromise is not supported on a SyncWaterfallHook")};const COMPILE=function(e){s.setup(this,e);return s.create(e)};function SyncWaterfallHook(e=[],t=undefined){if(e.length<1)throw new Error("Waterfall hooks must have at least one argument");const n=new o(e,t);n.constructor=SyncWaterfallHook;n.tapAsync=TAP_ASYNC;n.tapPromise=TAP_PROMISE;n.compile=COMPILE;return n}SyncWaterfallHook.prototype=null;e.exports=SyncWaterfallHook},837:e=>{e.exports=require("util")}};var t={};function __nccwpck_require__(n){var o=t[n];if(o!==undefined){return o.exports}var r=t[n]={exports:{}};var s=true;try{e[n](r,r.exports,__nccwpck_require__);s=false}finally{if(s)delete t[n]}return r.exports}if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var n={};(()=>{var e=n;e.__esModule=true;e.SyncHook=__nccwpck_require__(856);e.SyncBailHook=__nccwpck_require__(130);e.SyncWaterfallHook=__nccwpck_require__(844);e.SyncLoopHook=__nccwpck_require__(925);e.AsyncParallelHook=__nccwpck_require__(598);e.AsyncParallelBailHook=__nccwpck_require__(410);e.AsyncSeriesHook=__nccwpck_require__(97);e.AsyncSeriesBailHook=__nccwpck_require__(178);e.AsyncSeriesLoopHook=__nccwpck_require__(243);e.AsyncSeriesWaterfallHook=__nccwpck_require__(969);e.HookMap=__nccwpck_require__(876);e.MultiHook=__nccwpck_require__(274)})();module.exports=n})();
|
package/compiled/tapable/license
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
The MIT License
|
|
2
|
-
|
|
3
|
-
Copyright JS Foundation and other contributors
|
|
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
|
|
13
|
-
all 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
|
|
21
|
-
THE SOFTWARE.
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"name":"tapable","author":"Tobias Koppers @sokra","version":"2.2.1","license":"MIT","types":"./tapable.d.ts"}
|
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
type FixedSizeArray<T extends number, U> = T extends 0
|
|
2
|
-
? void[]
|
|
3
|
-
: ReadonlyArray<U> & {
|
|
4
|
-
0: U;
|
|
5
|
-
length: T;
|
|
6
|
-
};
|
|
7
|
-
type Measure<T extends number> = T extends 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8
|
|
8
|
-
? T
|
|
9
|
-
: never;
|
|
10
|
-
type Append<T extends any[], U> = {
|
|
11
|
-
0: [U];
|
|
12
|
-
1: [T[0], U];
|
|
13
|
-
2: [T[0], T[1], U];
|
|
14
|
-
3: [T[0], T[1], T[2], U];
|
|
15
|
-
4: [T[0], T[1], T[2], T[3], U];
|
|
16
|
-
5: [T[0], T[1], T[2], T[3], T[4], U];
|
|
17
|
-
6: [T[0], T[1], T[2], T[3], T[4], T[5], U];
|
|
18
|
-
7: [T[0], T[1], T[2], T[3], T[4], T[5], T[6], U];
|
|
19
|
-
8: [T[0], T[1], T[2], T[3], T[4], T[5], T[6], T[7], U];
|
|
20
|
-
}[Measure<T["length"]>];
|
|
21
|
-
type AsArray<T> = T extends any[] ? T : [T];
|
|
22
|
-
|
|
23
|
-
declare class UnsetAdditionalOptions {
|
|
24
|
-
_UnsetAdditionalOptions: true
|
|
25
|
-
}
|
|
26
|
-
type IfSet<X> = X extends UnsetAdditionalOptions ? {} : X;
|
|
27
|
-
|
|
28
|
-
type Callback<E, T> = (error: E | null, result?: T) => void;
|
|
29
|
-
type InnerCallback<E, T> = (error?: E | null | false, result?: T) => void;
|
|
30
|
-
|
|
31
|
-
type FullTap = Tap & {
|
|
32
|
-
type: "sync" | "async" | "promise",
|
|
33
|
-
fn: Function
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
type Tap = TapOptions & {
|
|
37
|
-
name: string;
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
type TapOptions = {
|
|
41
|
-
before?: string;
|
|
42
|
-
stage?: number;
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
interface HookInterceptor<T, R, AdditionalOptions = UnsetAdditionalOptions> {
|
|
46
|
-
name?: string;
|
|
47
|
-
tap?: (tap: FullTap & IfSet<AdditionalOptions>) => void;
|
|
48
|
-
call?: (...args: any[]) => void;
|
|
49
|
-
loop?: (...args: any[]) => void;
|
|
50
|
-
error?: (err: Error) => void;
|
|
51
|
-
result?: (result: R) => void;
|
|
52
|
-
done?: () => void;
|
|
53
|
-
register?: (tap: FullTap & IfSet<AdditionalOptions>) => FullTap & IfSet<AdditionalOptions>;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
type ArgumentNames<T extends any[]> = FixedSizeArray<T["length"], string>;
|
|
57
|
-
|
|
58
|
-
declare class Hook<T, R, AdditionalOptions = UnsetAdditionalOptions> {
|
|
59
|
-
constructor(args?: ArgumentNames<AsArray<T>>, name?: string);
|
|
60
|
-
name: string | undefined;
|
|
61
|
-
taps: FullTap[];
|
|
62
|
-
intercept(interceptor: HookInterceptor<T, R, AdditionalOptions>): void;
|
|
63
|
-
isUsed(): boolean;
|
|
64
|
-
callAsync(...args: Append<AsArray<T>, Callback<Error, R>>): void;
|
|
65
|
-
promise(...args: AsArray<T>): Promise<R>;
|
|
66
|
-
tap(options: string | Tap & IfSet<AdditionalOptions>, fn: (...args: AsArray<T>) => R): void;
|
|
67
|
-
withOptions(options: TapOptions & IfSet<AdditionalOptions>): Omit<this, "call" | "callAsync" | "promise">;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
export class SyncHook<T, R = void, AdditionalOptions = UnsetAdditionalOptions> extends Hook<T, R, AdditionalOptions> {
|
|
71
|
-
call(...args: AsArray<T>): R;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
export class SyncBailHook<T, R, AdditionalOptions = UnsetAdditionalOptions> extends SyncHook<T, R, AdditionalOptions> {}
|
|
75
|
-
export class SyncLoopHook<T, AdditionalOptions = UnsetAdditionalOptions> extends SyncHook<T, void, AdditionalOptions> {}
|
|
76
|
-
export class SyncWaterfallHook<T, AdditionalOptions = UnsetAdditionalOptions> extends SyncHook<T, AsArray<T>[0], AdditionalOptions> {}
|
|
77
|
-
|
|
78
|
-
declare class AsyncHook<T, R, AdditionalOptions = UnsetAdditionalOptions> extends Hook<T, R, AdditionalOptions> {
|
|
79
|
-
tapAsync(
|
|
80
|
-
options: string | Tap & IfSet<AdditionalOptions>,
|
|
81
|
-
fn: (...args: Append<AsArray<T>, InnerCallback<Error, R>>) => void
|
|
82
|
-
): void;
|
|
83
|
-
tapPromise(
|
|
84
|
-
options: string | Tap & IfSet<AdditionalOptions>,
|
|
85
|
-
fn: (...args: AsArray<T>) => Promise<R>
|
|
86
|
-
): void;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
export class AsyncParallelHook<T, AdditionalOptions = UnsetAdditionalOptions> extends AsyncHook<T, void, AdditionalOptions> {}
|
|
90
|
-
export class AsyncParallelBailHook<T, R, AdditionalOptions = UnsetAdditionalOptions> extends AsyncHook<T, R, AdditionalOptions> {}
|
|
91
|
-
export class AsyncSeriesHook<T, AdditionalOptions = UnsetAdditionalOptions> extends AsyncHook<T, void, AdditionalOptions> {}
|
|
92
|
-
export class AsyncSeriesBailHook<T, R, AdditionalOptions = UnsetAdditionalOptions> extends AsyncHook<T, R, AdditionalOptions> {}
|
|
93
|
-
export class AsyncSeriesLoopHook<T, AdditionalOptions = UnsetAdditionalOptions> extends AsyncHook<T, void, AdditionalOptions> {}
|
|
94
|
-
export class AsyncSeriesWaterfallHook<T, AdditionalOptions = UnsetAdditionalOptions> extends AsyncHook<T, AsArray<T>[0], AdditionalOptions> {}
|
|
95
|
-
|
|
96
|
-
type HookFactory<H> = (key: any, hook?: H) => H;
|
|
97
|
-
|
|
98
|
-
interface HookMapInterceptor<H> {
|
|
99
|
-
factory?: HookFactory<H>;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
export class HookMap<H> {
|
|
103
|
-
constructor(factory: HookFactory<H>, name?: string);
|
|
104
|
-
name: string | undefined;
|
|
105
|
-
get(key: any): H | undefined;
|
|
106
|
-
for(key: any): H;
|
|
107
|
-
intercept(interceptor: HookMapInterceptor<H>): void;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
export class MultiHook<H> {
|
|
111
|
-
constructor(hooks: H[], name?: string);
|
|
112
|
-
name: string | undefined;
|
|
113
|
-
tap(options: string | Tap, fn?: Function): void;
|
|
114
|
-
tapAsync(options: string | Tap, fn?: Function): void;
|
|
115
|
-
tapPromise(options: string | Tap, fn?: Function): void;
|
|
116
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export = any;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(()=>{var e={209:(e,t,s)=>{"use strict";const n=s(799);const r=s(692);const i=s(951);const u=s(757);const mapToBufferedMap=e=>{if(typeof e!=="object"||!e)return e;const t=Object.assign({},e);if(e.mappings){t.mappings=Buffer.from(e.mappings,"utf-8")}if(e.sourcesContent){t.sourcesContent=e.sourcesContent.map((e=>e&&Buffer.from(e,"utf-8")))}return t};const bufferedMapToMap=e=>{if(typeof e!=="object"||!e)return e;const t=Object.assign({},e);if(e.mappings){t.mappings=e.mappings.toString("utf-8")}if(e.sourcesContent){t.sourcesContent=e.sourcesContent.map((e=>e&&e.toString("utf-8")))}return t};class CachedSource extends n{constructor(e,t){super();this._source=e;this._cachedSourceType=t?t.source:undefined;this._cachedSource=undefined;this._cachedBuffer=t?t.buffer:undefined;this._cachedSize=t?t.size:undefined;this._cachedMaps=t?t.maps:new Map;this._cachedHashUpdate=t?t.hash:undefined}getCachedData(){const e=new Map;for(const t of this._cachedMaps){let s=t[1];if(s.bufferedMap===undefined){s.bufferedMap=mapToBufferedMap(this._getMapFromCacheEntry(s))}e.set(t[0],{map:undefined,bufferedMap:s.bufferedMap})}if(this._cachedSource){this.buffer()}return{buffer:this._cachedBuffer,source:this._cachedSourceType!==undefined?this._cachedSourceType:typeof this._cachedSource==="string"?true:Buffer.isBuffer(this._cachedSource)?false:undefined,size:this._cachedSize,maps:e,hash:this._cachedHashUpdate}}originalLazy(){return this._source}original(){if(typeof this._source==="function")this._source=this._source();return this._source}source(){const e=this._getCachedSource();if(e!==undefined)return e;return this._cachedSource=this.original().source()}_getMapFromCacheEntry(e){if(e.map!==undefined){return e.map}else if(e.bufferedMap!==undefined){return e.map=bufferedMapToMap(e.bufferedMap)}}_getCachedSource(){if(this._cachedSource!==undefined)return this._cachedSource;if(this._cachedBuffer&&this._cachedSourceType!==undefined){return this._cachedSource=this._cachedSourceType?this._cachedBuffer.toString("utf-8"):this._cachedBuffer}}buffer(){if(this._cachedBuffer!==undefined)return this._cachedBuffer;if(this._cachedSource!==undefined){if(Buffer.isBuffer(this._cachedSource)){return this._cachedBuffer=this._cachedSource}return this._cachedBuffer=Buffer.from(this._cachedSource,"utf-8")}if(typeof this.original().buffer==="function"){return this._cachedBuffer=this.original().buffer()}const e=this.source();if(Buffer.isBuffer(e)){return this._cachedBuffer=e}return this._cachedBuffer=Buffer.from(e,"utf-8")}size(){if(this._cachedSize!==undefined)return this._cachedSize;if(this._cachedBuffer!==undefined){return this._cachedSize=this._cachedBuffer.length}const e=this._getCachedSource();if(e!==undefined){return this._cachedSize=Buffer.byteLength(e)}return this._cachedSize=this.original().size()}sourceAndMap(e){const t=e?JSON.stringify(e):"{}";const s=this._cachedMaps.get(t);if(s!==undefined){const e=this._getMapFromCacheEntry(s);return{source:this.source(),map:e}}let n=this._getCachedSource();let r;if(n!==undefined){r=this.original().map(e)}else{const t=this.original().sourceAndMap(e);n=t.source;r=t.map;this._cachedSource=n}this._cachedMaps.set(t,{map:r,bufferedMap:undefined});return{source:n,map:r}}streamChunks(e,t,s,n){const o=e?JSON.stringify(e):"{}";if(this._cachedMaps.has(o)&&(this._cachedBuffer!==undefined||this._cachedSource!==undefined)){const{source:u,map:o}=this.sourceAndMap(e);if(o){return r(u,o,t,s,n,!!(e&&e.finalSource),true)}else{return i(u,t,s,n,!!(e&&e.finalSource))}}const{result:f,source:c,map:a}=u(this.original(),e,t,s,n);this._cachedSource=c;this._cachedMaps.set(o,{map:a,bufferedMap:undefined});return f}map(e){const t=e?JSON.stringify(e):"{}";const s=this._cachedMaps.get(t);if(s!==undefined){return this._getMapFromCacheEntry(s)}const n=this.original().map(e);this._cachedMaps.set(t,{map:n,bufferedMap:undefined});return n}updateHash(e){if(this._cachedHashUpdate!==undefined){for(const t of this._cachedHashUpdate)e.update(t);return}const t=[];let s=undefined;const n={update:e=>{if(typeof e==="string"&&e.length<10240){if(s===undefined){s=e}else{s+=e;if(s.length>102400){t.push(Buffer.from(s));s=undefined}}}else{if(s!==undefined){t.push(Buffer.from(s));s=undefined}t.push(e)}}};this.original().updateHash(n);if(s!==undefined){t.push(Buffer.from(s))}for(const s of t)e.update(s);this._cachedHashUpdate=t}}e.exports=CachedSource},147:(e,t,s)=>{"use strict";const n=s(799);class CompatSource extends n{static from(e){return e instanceof n?e:new CompatSource(e)}constructor(e){super();this._sourceLike=e}source(){return this._sourceLike.source()}buffer(){if(typeof this._sourceLike.buffer==="function"){return this._sourceLike.buffer()}return super.buffer()}size(){if(typeof this._sourceLike.size==="function"){return this._sourceLike.size()}return super.size()}map(e){if(typeof this._sourceLike.map==="function"){return this._sourceLike.map(e)}return super.map(e)}sourceAndMap(e){if(typeof this._sourceLike.sourceAndMap==="function"){return this._sourceLike.sourceAndMap(e)}return super.sourceAndMap(e)}updateHash(e){if(typeof this._sourceLike.updateHash==="function"){return this._sourceLike.updateHash(e)}if(typeof this._sourceLike.map==="function"){throw new Error("A Source-like object with a 'map' method must also provide an 'updateHash' method")}e.update(this.buffer())}}e.exports=CompatSource},172:(e,t,s)=>{"use strict";const n=s(799);const r=s(851);const i=s(641);const{getMap:u,getSourceAndMap:o}=s(771);const f=new WeakSet;class ConcatSource extends n{constructor(){super();this._children=[];for(let e=0;e<arguments.length;e++){const t=arguments[e];if(t instanceof ConcatSource){for(const e of t._children){this._children.push(e)}}else{this._children.push(t)}}this._isOptimized=arguments.length===0}getChildren(){if(!this._isOptimized)this._optimize();return this._children}add(e){if(e instanceof ConcatSource){for(const t of e._children){this._children.push(t)}}else{this._children.push(e)}this._isOptimized=false}addAllSkipOptimizing(e){for(const t of e){this._children.push(t)}}buffer(){if(!this._isOptimized)this._optimize();const e=[];for(const t of this._children){if(typeof t.buffer==="function"){e.push(t.buffer())}else{const s=t.source();if(Buffer.isBuffer(s)){e.push(s)}else{e.push(Buffer.from(s,"utf-8"))}}}return Buffer.concat(e)}source(){if(!this._isOptimized)this._optimize();let e="";for(const t of this._children){e+=t.source()}return e}size(){if(!this._isOptimized)this._optimize();let e=0;for(const t of this._children){e+=t.size()}return e}map(e){return u(this,e)}sourceAndMap(e){return o(this,e)}streamChunks(e,t,s,n){if(!this._isOptimized)this._optimize();if(this._children.length===1)return this._children[0].streamChunks(e,t,s,n);let r=0;let u=0;let o=new Map;let f=new Map;const c=!!(e&&e.finalSource);let a="";let h=false;for(const l of this._children){const d=[];const p=[];let _=0;const{generatedLine:g,generatedColumn:S,source:m}=i(l,e,((e,s,n,i,o,f,l)=>{const g=s+r;const S=s===1?n+u:n;if(h){if(s!==1||n!==0){t(undefined,r+1,u,-1,-1,-1,-1)}h=false}const m=i<0||i>=d.length?-1:d[i];const A=l<0||l>=p.length?-1:p[l];_=m<0?0:s;if(c){if(e!==undefined)a+=e;if(m>=0){t(undefined,g,S,m,o,f,A)}}else{if(m<0){t(e,g,S,-1,-1,-1,-1)}else{t(e,g,S,m,o,f,A)}}}),((e,t,n)=>{let r=o.get(t);if(r===undefined){o.set(t,r=o.size);s(r,t,n)}d[e]=r}),((e,t)=>{let s=f.get(t);if(s===undefined){f.set(t,s=f.size);n(s,t)}p[e]=s}));if(m!==undefined)a+=m;if(h){if(g!==1||S!==0){t(undefined,r+1,u,-1,-1,-1,-1);h=false}}if(g>1){u=S}else{u+=S}h=h||c&&_===g;r+=g-1}return{generatedLine:r+1,generatedColumn:u,source:c?a:undefined}}updateHash(e){if(!this._isOptimized)this._optimize();e.update("ConcatSource");for(const t of this._children){t.updateHash(e)}}_optimize(){const e=[];let t=undefined;let s=undefined;const addStringToRawSources=e=>{if(s===undefined){s=e}else if(Array.isArray(s)){s.push(e)}else{s=[typeof s==="string"?s:s.source(),e]}};const addSourceToRawSources=e=>{if(s===undefined){s=e}else if(Array.isArray(s)){s.push(e.source())}else{s=[typeof s==="string"?s:s.source(),e.source()]}};const mergeRawSources=()=>{if(Array.isArray(s)){const t=new r(s.join(""));f.add(t);e.push(t)}else if(typeof s==="string"){const t=new r(s);f.add(t);e.push(t)}else{e.push(s)}};for(const n of this._children){if(typeof n==="string"){if(t===undefined){t=n}else{t+=n}}else{if(t!==undefined){addStringToRawSources(t);t=undefined}if(f.has(n)){addSourceToRawSources(n)}else{if(s!==undefined){mergeRawSources();s=undefined}e.push(n)}}}if(t!==undefined){addStringToRawSources(t)}if(s!==undefined){mergeRawSources()}this._children=e;this._isOptimized=true}}e.exports=ConcatSource},297:(e,t,s)=>{"use strict";const{getMap:n,getSourceAndMap:r}=s(771);const i=s(901);const u=s(151);const o=s(799);const f=s(820);class OriginalSource extends o{constructor(e,t){super();const s=Buffer.isBuffer(e);this._value=s?undefined:e;this._valueAsBuffer=s?e:undefined;this._name=t}getName(){return this._name}source(){if(this._value===undefined){this._value=this._valueAsBuffer.toString("utf-8")}return this._value}buffer(){if(this._valueAsBuffer===undefined){this._valueAsBuffer=Buffer.from(this._value,"utf-8")}return this._valueAsBuffer}map(e){return n(this,e)}sourceAndMap(e){return r(this,e)}streamChunks(e,t,s,n){if(this._value===undefined){this._value=this._valueAsBuffer.toString("utf-8")}s(0,this._name,this._value);const r=!!(e&&e.finalSource);if(!e||e.columns!==false){const e=f(this._value);let s=1;let n=0;if(e!==null){for(const i of e){const e=i.endsWith("\n");if(e&&i.length===1){if(!r)t(i,s,n,-1,-1,-1,-1)}else{const e=r?undefined:i;t(e,s,n,0,s,n,-1)}if(e){s++;n=0}else{n+=i.length}}}return{generatedLine:s,generatedColumn:n,source:r?this._value:undefined}}else if(r){const e=u(this._value);const{generatedLine:s,generatedColumn:n}=e;if(n===0){for(let e=1;e<s;e++)t(undefined,e,0,0,e,0,-1)}else{for(let e=1;e<=s;e++)t(undefined,e,0,0,e,0,-1)}return e}else{let e=1;const s=i(this._value);let n;for(n of s){t(r?undefined:n,e,0,0,e,0,-1);e++}return s.length===0||n.endsWith("\n")?{generatedLine:s.length+1,generatedColumn:0,source:r?this._value:undefined}:{generatedLine:s.length,generatedColumn:n.length,source:r?this._value:undefined}}}updateHash(e){if(this._valueAsBuffer===undefined){this._valueAsBuffer=Buffer.from(this._value,"utf-8")}e.update("OriginalSource");e.update(this._valueAsBuffer);e.update(this._name||"")}}e.exports=OriginalSource},516:(e,t,s)=>{"use strict";const n=s(799);const r=s(851);const i=s(641);const{getMap:u,getSourceAndMap:o}=s(771);const f=/\n(?=.|\s)/g;class PrefixSource extends n{constructor(e,t){super();this._source=typeof t==="string"||Buffer.isBuffer(t)?new r(t,true):t;this._prefix=e}getPrefix(){return this._prefix}original(){return this._source}source(){const e=this._source.source();const t=this._prefix;return t+e.replace(f,"\n"+t)}map(e){return u(this,e)}sourceAndMap(e){return o(this,e)}streamChunks(e,t,s,n){const r=this._prefix;const u=r.length;const o=!!(e&&e.columns===false);const{generatedLine:c,generatedColumn:a,source:h}=i(this._source,e,((e,s,n,i,f,c,a)=>{if(n!==0){n+=u}else if(e!==undefined){if(o||i<0){e=r+e}else if(u>0){t(r,s,n,-1,-1,-1,-1);n+=u}}else if(!o){n+=u}t(e,s,n,i,f,c,a)}),s,n);return{generatedLine:c,generatedColumn:a===0?0:u+a,source:h!==undefined?r+h.replace(f,"\n"+r):undefined}}updateHash(e){e.update("PrefixSource");this._source.updateHash(e);e.update(this._prefix)}}e.exports=PrefixSource},851:(e,t,s)=>{"use strict";const n=s(951);const r=s(799);class RawSource extends r{constructor(e,t=false){super();const s=Buffer.isBuffer(e);if(!s&&typeof e!=="string"){throw new TypeError("argument 'value' must be either string of Buffer")}this._valueIsBuffer=!t&&s;this._value=t&&s?undefined:e;this._valueAsBuffer=s?e:undefined;this._valueAsString=s?undefined:e}isBuffer(){return this._valueIsBuffer}source(){if(this._value===undefined){this._value=this._valueAsBuffer.toString("utf-8")}return this._value}buffer(){if(this._valueAsBuffer===undefined){this._valueAsBuffer=Buffer.from(this._value,"utf-8")}return this._valueAsBuffer}map(e){return null}streamChunks(e,t,s,r){if(this._value===undefined){this._value=Buffer.from(this._valueAsBuffer,"utf-8")}if(this._valueAsString===undefined){this._valueAsString=typeof this._value==="string"?this._value:this._value.toString("utf-8")}return n(this._valueAsString,t,s,r,!!(e&&e.finalSource))}updateHash(e){if(this._valueAsBuffer===undefined){this._valueAsBuffer=Buffer.from(this._value,"utf-8")}e.update("RawSource");e.update(this._valueAsBuffer)}}e.exports=RawSource},653:(e,t,s)=>{"use strict";const{getMap:n,getSourceAndMap:r}=s(771);const i=s(641);const u=s(799);const o=s(901);const f=typeof process==="object"&&process.versions&&typeof process.versions.v8==="string"&&!/^[0-6]\./.test(process.versions.v8);const c=536870912;class Replacement{constructor(e,t,s,n){this.start=e;this.end=t;this.content=s;this.name=n;if(!f){this.index=-1}}}class ReplaceSource extends u{constructor(e,t){super();this._source=e;this._name=t;this._replacements=[];this._isSorted=true}getName(){return this._name}getReplacements(){this._sortReplacements();return this._replacements}replace(e,t,s,n){if(typeof s!=="string")throw new Error("insertion must be a string, but is a "+typeof s);this._replacements.push(new Replacement(e,t,s,n));this._isSorted=false}insert(e,t,s){if(typeof t!=="string")throw new Error("insertion must be a string, but is a "+typeof t+": "+t);this._replacements.push(new Replacement(e,e-1,t,s));this._isSorted=false}source(){if(this._replacements.length===0){return this._source.source()}let e=this._source.source();let t=0;const s=[];this._sortReplacements();for(const n of this._replacements){const r=Math.floor(n.start);const i=Math.floor(n.end+1);if(t<r){const n=r-t;s.push(e.slice(0,n));e=e.slice(n);t=r}s.push(n.content);if(t<i){const s=i-t;e=e.slice(s);t=i}}s.push(e);return s.join("")}map(e){if(this._replacements.length===0){return this._source.map(e)}return n(this,e)}sourceAndMap(e){if(this._replacements.length===0){return this._source.sourceAndMap(e)}return r(this,e)}original(){return this._source}_sortReplacements(){if(this._isSorted)return;if(f){this._replacements.sort((function(e,t){const s=e.start-t.start;if(s!==0)return s;const n=e.end-t.end;if(n!==0)return n;return 0}))}else{this._replacements.forEach(((e,t)=>e.index=t));this._replacements.sort((function(e,t){const s=e.start-t.start;if(s!==0)return s;const n=e.end-t.end;if(n!==0)return n;return e.index-t.index}))}this._isSorted=true}streamChunks(e,t,s,n){this._sortReplacements();const r=this._replacements;let u=0;let f=0;let a=-1;let h=f<r.length?Math.floor(r[f].start):c;let l=0;let d=0;let p=0;const _=[];const g=new Map;const S=[];const checkOriginalContent=(e,t,s,n)=>{let r=e<_.length?_[e]:undefined;if(r===undefined)return false;if(typeof r==="string"){r=o(r);_[e]=r}const i=t<=r.length?r[t-1]:null;if(i===null)return false;return i.slice(s,s+n.length)===n};let{generatedLine:m,generatedColumn:A}=i(this._source,Object.assign({},e,{finalSource:false}),((e,s,i,_,m,A,M)=>{let B=0;let v=u+e.length;if(a>u){if(a>=v){const t=s+l;if(e.endsWith("\n")){l--;if(p===t){d+=i}}else if(p===t){d-=e.length}else{d=-e.length;p=t}u=v;return}B=a-u;if(checkOriginalContent(_,m,A,e.slice(0,B))){A+=B}u+=B;const t=s+l;if(p===t){d-=B}else{d=-B;p=t}i+=B}if(h<v){do{let C=s+l;if(h>u){const s=h-u;const n=e.slice(B,B+s);t(n,C,i+(C===p?d:0),_,m,A,M<0||M>=S.length?-1:S[M]);i+=s;B+=s;u=h;if(checkOriginalContent(_,m,A,n)){A+=n.length}}const{content:b,name:O}=r[f];let y=o(b);let w=M;if(_>=0&&O){let e=g.get(O);if(e===undefined){e=g.size;g.set(O,e);n(e,O)}w=e}for(let e=0;e<y.length;e++){const s=y[e];t(s,C,i+(C===p?d:0),_,m,A,w);w=-1;if(e===y.length-1&&!s.endsWith("\n")){if(p===C){d+=s.length}else{d=s.length;p=C}}else{l++;C++;d=-i;p=C}}a=Math.max(a,Math.floor(r[f].end+1));f++;h=f<r.length?Math.floor(r[f].start):c;const x=e.length-v+a-B;if(x>0){if(a>=v){let t=s+l;if(e.endsWith("\n")){l--;if(p===t){d+=i}}else if(p===t){d-=e.length-B}else{d=B-e.length;p=t}u=v;return}const t=s+l;if(checkOriginalContent(_,m,A,e.slice(B,B+x))){A+=x}B+=x;u+=x;if(p===t){d-=x}else{d=-x;p=t}i+=x}}while(h<v)}if(B<e.length){const n=B===0?e:e.slice(B);const r=s+l;t(n,r,i+(r===p?d:0),_,m,A,M<0?-1:S[M])}u=v}),((e,t,n)=>{while(_.length<e)_.push(undefined);_[e]=n;s(e,t,n)}),((e,t)=>{let s=g.get(t);if(s===undefined){s=g.size;g.set(t,s);n(s,t)}S[e]=s}));let M="";for(;f<r.length;f++){M+=r[f].content}let B=m+l;let v=o(M);for(let e=0;e<v.length;e++){const s=v[e];t(s,B,A+(B===p?d:0),-1,-1,-1,-1);if(e===v.length-1&&!s.endsWith("\n")){if(p===B){d+=s.length}else{d=s.length;p=B}}else{l++;B++;d=-A;p=B}}return{generatedLine:B,generatedColumn:A+(B===p?d:0)}}updateHash(e){this._sortReplacements();e.update("ReplaceSource");this._source.updateHash(e);e.update(this._name||"");for(const t of this._replacements){e.update(`${t.start}${t.end}${t.content}${t.name}`)}}}e.exports=ReplaceSource},107:(e,t,s)=>{"use strict";const n=s(799);class SizeOnlySource extends n{constructor(e){super();this._size=e}_error(){return new Error("Content and Map of this Source is not available (only size() is supported)")}size(){return this._size}source(){throw this._error()}buffer(){throw this._error()}map(e){throw this._error()}updateHash(){throw this._error()}}e.exports=SizeOnlySource},799:e=>{"use strict";class Source{source(){throw new Error("Abstract")}buffer(){const e=this.source();if(Buffer.isBuffer(e))return e;return Buffer.from(e,"utf-8")}size(){return this.buffer().length}map(e){return null}sourceAndMap(e){return{source:this.source(),map:this.map(e)}}updateHash(e){throw new Error("Abstract")}}e.exports=Source},890:(e,t,s)=>{"use strict";const n=s(799);const r=s(692);const i=s(153);const{getMap:u,getSourceAndMap:o}=s(771);class SourceMapSource extends n{constructor(e,t,s,n,r,i){super();const u=Buffer.isBuffer(e);this._valueAsString=u?undefined:e;this._valueAsBuffer=u?e:undefined;this._name=t;this._hasSourceMap=!!s;const o=Buffer.isBuffer(s);const f=typeof s==="string";this._sourceMapAsObject=o||f?undefined:s;this._sourceMapAsString=f?s:undefined;this._sourceMapAsBuffer=o?s:undefined;this._hasOriginalSource=!!n;const c=Buffer.isBuffer(n);this._originalSourceAsString=c?undefined:n;this._originalSourceAsBuffer=c?n:undefined;this._hasInnerSourceMap=!!r;const a=Buffer.isBuffer(r);const h=typeof r==="string";this._innerSourceMapAsObject=a||h?undefined:r;this._innerSourceMapAsString=h?r:undefined;this._innerSourceMapAsBuffer=a?r:undefined;this._removeOriginalSource=i}_ensureValueBuffer(){if(this._valueAsBuffer===undefined){this._valueAsBuffer=Buffer.from(this._valueAsString,"utf-8")}}_ensureValueString(){if(this._valueAsString===undefined){this._valueAsString=this._valueAsBuffer.toString("utf-8")}}_ensureOriginalSourceBuffer(){if(this._originalSourceAsBuffer===undefined&&this._hasOriginalSource){this._originalSourceAsBuffer=Buffer.from(this._originalSourceAsString,"utf-8")}}_ensureOriginalSourceString(){if(this._originalSourceAsString===undefined&&this._hasOriginalSource){this._originalSourceAsString=this._originalSourceAsBuffer.toString("utf-8")}}_ensureInnerSourceMapObject(){if(this._innerSourceMapAsObject===undefined&&this._hasInnerSourceMap){this._ensureInnerSourceMapString();this._innerSourceMapAsObject=JSON.parse(this._innerSourceMapAsString)}}_ensureInnerSourceMapBuffer(){if(this._innerSourceMapAsBuffer===undefined&&this._hasInnerSourceMap){this._ensureInnerSourceMapString();this._innerSourceMapAsBuffer=Buffer.from(this._innerSourceMapAsString,"utf-8")}}_ensureInnerSourceMapString(){if(this._innerSourceMapAsString===undefined&&this._hasInnerSourceMap){if(this._innerSourceMapAsBuffer!==undefined){this._innerSourceMapAsString=this._innerSourceMapAsBuffer.toString("utf-8")}else{this._innerSourceMapAsString=JSON.stringify(this._innerSourceMapAsObject)}}}_ensureSourceMapObject(){if(this._sourceMapAsObject===undefined){this._ensureSourceMapString();this._sourceMapAsObject=JSON.parse(this._sourceMapAsString)}}_ensureSourceMapBuffer(){if(this._sourceMapAsBuffer===undefined){this._ensureSourceMapString();this._sourceMapAsBuffer=Buffer.from(this._sourceMapAsString,"utf-8")}}_ensureSourceMapString(){if(this._sourceMapAsString===undefined){if(this._sourceMapAsBuffer!==undefined){this._sourceMapAsString=this._sourceMapAsBuffer.toString("utf-8")}else{this._sourceMapAsString=JSON.stringify(this._sourceMapAsObject)}}}getArgsAsBuffers(){this._ensureValueBuffer();this._ensureSourceMapBuffer();this._ensureOriginalSourceBuffer();this._ensureInnerSourceMapBuffer();return[this._valueAsBuffer,this._name,this._sourceMapAsBuffer,this._originalSourceAsBuffer,this._innerSourceMapAsBuffer,this._removeOriginalSource]}buffer(){this._ensureValueBuffer();return this._valueAsBuffer}source(){this._ensureValueString();return this._valueAsString}map(e){if(!this._hasInnerSourceMap){this._ensureSourceMapObject();return this._sourceMapAsObject}return u(this,e)}sourceAndMap(e){if(!this._hasInnerSourceMap){this._ensureValueString();this._ensureSourceMapObject();return{source:this._valueAsString,map:this._sourceMapAsObject}}return o(this,e)}streamChunks(e,t,s,n){this._ensureValueString();this._ensureSourceMapObject();this._ensureOriginalSourceString();if(this._hasInnerSourceMap){this._ensureInnerSourceMapObject();return i(this._valueAsString,this._sourceMapAsObject,this._name,this._originalSourceAsString,this._innerSourceMapAsObject,this._removeOriginalSource,t,s,n,!!(e&&e.finalSource),!!(e&&e.columns!==false))}else{return r(this._valueAsString,this._sourceMapAsObject,t,s,n,!!(e&&e.finalSource),!!(e&&e.columns!==false))}}updateHash(e){this._ensureValueBuffer();this._ensureSourceMapBuffer();this._ensureOriginalSourceBuffer();this._ensureInnerSourceMapBuffer();e.update("SourceMapSource");e.update(this._valueAsBuffer);e.update(this._sourceMapAsBuffer);if(this._hasOriginalSource){e.update(this._originalSourceAsBuffer)}if(this._hasInnerSourceMap){e.update(this._innerSourceMapAsBuffer)}e.update(this._removeOriginalSource?"true":"false")}}e.exports=SourceMapSource},158:e=>{"use strict";const t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");const s=32;const createMappingsSerializer=e=>{const t=e&&e.columns===false;return t?createLinesOnlyMappingsSerializer():createFullMappingsSerializer()};const createFullMappingsSerializer=()=>{let e=1;let n=0;let r=0;let i=1;let u=0;let o=0;let f=false;let c=false;let a=true;return(h,l,d,p,_,g)=>{if(f&&e===h){if(d===r&&p===i&&_===u&&!c&&g<0){return""}}else{if(d<0){return""}}let S;if(e<h){S=";".repeat(h-e);e=h;n=0;a=false}else if(a){S="";a=false}else{S=","}const writeValue=e=>{const n=e>>>31&1;const r=e>>31;const i=e+r^r;let u=i<<1|n;for(;;){const e=u&31;u>>=5;if(u===0){S+=t[e];break}else{S+=t[e|s]}}};writeValue(l-n);n=l;if(d>=0){f=true;if(d===r){S+="A"}else{writeValue(d-r);r=d}writeValue(p-i);i=p;if(_===u){S+="A"}else{writeValue(_-u);u=_}if(g>=0){writeValue(g-o);o=g;c=true}else{c=false}}else{f=false}return S}};const createLinesOnlyMappingsSerializer=()=>{let e=0;let n=1;let r=0;let i=1;return(u,o,f,c,a,h)=>{if(f<0){return""}if(e===u){return""}let l;const writeValue=e=>{const n=e>>>31&1;const r=e>>31;const i=e+r^r;let u=i<<1|n;for(;;){const e=u&31;u>>=5;if(u===0){l+=t[e];break}else{l+=t[e|s]}}};e=u;if(u===n+1){n=u;if(f===r){r=f;if(c===i+1){i=c;return";AACA"}else{l=";AA";writeValue(c-i);i=c;return l+"A"}}else{l=";A";writeValue(f-r);r=f;writeValue(c-i);i=c;return l+"A"}}else{l=";".repeat(u-n);n=u;if(f===r){r=f;if(c===i+1){i=c;return l+"AACA"}else{l+="AA";writeValue(c-i);i=c;return l+"A"}}else{l+="A";writeValue(f-r);r=f;writeValue(c-i);i=c;return l+"A"}}}};e.exports=createMappingsSerializer},771:(e,t,s)=>{"use strict";const n=s(158);t.getSourceAndMap=(e,t)=>{let s="";let r="";let i=[];let u=[];let o=[];const f=n(t);const{source:c}=e.streamChunks(Object.assign({},t,{finalSource:true}),((e,t,n,i,u,o,c)=>{if(e!==undefined)s+=e;r+=f(t,n,i,u,o,c)}),((e,t,s)=>{while(i.length<e){i.push(null)}i[e]=t;if(s!==undefined){while(u.length<e){u.push(null)}u[e]=s}}),((e,t)=>{while(o.length<e){o.push(null)}o[e]=t}));return{source:c!==undefined?c:s,map:r.length>0?{version:3,file:"x",mappings:r,sources:i,sourcesContent:u.length>0?u:undefined,names:o}:null}};t.getMap=(e,t)=>{let s="";let r=[];let i=[];let u=[];const o=n(t);e.streamChunks(Object.assign({},t,{source:false,finalSource:true}),((e,t,n,r,i,u,f)=>{s+=o(t,n,r,i,u,f)}),((e,t,s)=>{while(r.length<e){r.push(null)}r[e]=t;if(s!==undefined){while(i.length<e){i.push(null)}i[e]=s}}),((e,t)=>{while(u.length<e){u.push(null)}u[e]=t}));return s.length>0?{version:3,file:"x",mappings:s,sources:r,sourcesContent:i.length>0?i:undefined,names:u}:null}},151:e=>{"use strict";const t="\n".charCodeAt(0);const getGeneratedSourceInfo=e=>{if(e===undefined){return{}}const s=e.lastIndexOf("\n");if(s===-1){return{generatedLine:1,generatedColumn:e.length,source:e}}let n=2;for(let r=0;r<s;r++){if(e.charCodeAt(r)===t)n++}return{generatedLine:n,generatedColumn:e.length-s-1,source:e}};e.exports=getGeneratedSourceInfo},634:e=>{"use strict";const getSource=(e,t)=>{if(t<0)return null;const{sourceRoot:s,sources:n}=e;const r=n[t];if(!s)return r;if(s.endsWith("/"))return s+r;return s+"/"+r};e.exports=getSource},320:e=>{"use strict";const t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";const s=32;const n=64;const r=n|1;const i=n|2;const u=31;const o=new Uint8Array("z".charCodeAt(0)+1);{o.fill(i);for(let e=0;e<t.length;e++){o[t.charCodeAt(e)]=e}o[",".charCodeAt(0)]=n;o[";".charCodeAt(0)]=r}const f=o.length-1;const readMappings=(e,t)=>{const i=new Uint32Array([0,0,1,0,0]);let c=0;let a=0;let h=0;let l=1;let d=-1;for(let p=0;p<e.length;p++){const _=e.charCodeAt(p);if(_>f)continue;const g=o[_];if((g&n)!==0){if(i[0]>d){if(c===1){t(l,i[0],-1,-1,-1,-1)}else if(c===4){t(l,i[0],i[1],i[2],i[3],-1)}else if(c===5){t(l,i[0],i[1],i[2],i[3],i[4])}d=i[0]}c=0;if(g===r){l++;i[0]=0;d=-1}}else if((g&s)===0){a|=g<<h;const e=a&1?-(a>>1):a>>1;i[c++]+=e;h=0;a=0}else{a|=(g&u)<<h;h+=5}}if(c===1){t(l,i[0],-1,-1,-1,-1)}else if(c===4){t(l,i[0],i[1],i[2],i[3],-1)}else if(c===5){t(l,i[0],i[1],i[2],i[3],i[4])}};e.exports=readMappings},901:e=>{const splitIntoLines=e=>{const t=[];const s=e.length;let n=0;for(;n<s;){const r=e.charCodeAt(n);if(r===10){t.push("\n");n++}else{let r=n+1;while(r<s&&e.charCodeAt(r)!==10)r++;t.push(e.slice(n,r+1));n=r+1}}return t};e.exports=splitIntoLines},820:e=>{const splitIntoPotentialTokens=e=>{const t=e.length;if(t===0)return null;const s=[];let n=0;for(;n<t;){const r=n;e:{let s=e.charCodeAt(n);while(s!==10&&s!==59&&s!==123&&s!==125){if(++n>=t)break e;s=e.charCodeAt(n)}while(s===59||s===32||s===123||s===125||s===13||s===9){if(++n>=t)break e;s=e.charCodeAt(n)}if(s===10){n++}}s.push(e.slice(r,n))}return s};e.exports=splitIntoPotentialTokens},757:(e,t,s)=>{"use strict";const n=s(158);const r=s(641);const streamAndGetSourceAndMap=(e,t,s,i,u)=>{let o="";let f="";let c=[];let a=[];let h=[];const l=n(Object.assign({},t,{columns:true}));const d=!!(t&&t.finalSource);const{generatedLine:p,generatedColumn:_,source:g}=r(e,t,((e,t,n,r,i,u,c)=>{if(e!==undefined)o+=e;f+=l(t,n,r,i,u,c);return s(d?undefined:e,t,n,r,i,u,c)}),((e,t,s)=>{while(c.length<e){c.push(null)}c[e]=t;if(s!==undefined){while(a.length<e){a.push(null)}a[e]=s}return i(e,t,s)}),((e,t)=>{while(h.length<e){h.push(null)}h[e]=t;return u(e,t)}));const S=g!==undefined?g:o;return{result:{generatedLine:p,generatedColumn:_,source:d?S:undefined},source:S,map:f.length>0?{version:3,file:"x",mappings:f,sources:c,sourcesContent:a.length>0?a:undefined,names:h}:null}};e.exports=streamAndGetSourceAndMap},641:(e,t,s)=>{"use strict";const n=s(951);const r=s(692);e.exports=(e,t,s,i,u)=>{if(typeof e.streamChunks==="function"){return e.streamChunks(t,s,i,u)}else{const o=e.sourceAndMap(t);if(o.map){return r(o.source,o.map,s,i,u,!!(t&&t.finalSource),!!(t&&t.columns!==false))}else{return n(o.source,s,i,u,!!(t&&t.finalSource))}}}},153:(e,t,s)=>{"use strict";const n=s(692);const r=s(901);const streamChunksOfCombinedSourceMap=(e,t,s,i,u,o,f,c,a,h,l)=>{let d=new Map;let p=new Map;const _=[];const g=[];const S=[];let m=-2;const A=[];const M=[];const B=[];const v=[];const C=[];const b=[];const O=[];const findInnerMapping=(e,t)=>{if(e>O.length)return-1;const{mappingsData:s}=O[e-1];let n=0;let r=s.length/5;while(n<r){let e=n+r>>1;if(s[e*5]<=t){n=e+1}else{r=e}}if(n===0)return-1;return n-1};return n(e,t,((t,n,u,h,l,y,w)=>{if(h===m){const m=findInnerMapping(l,y);if(m!==-1){const{chunks:e,mappingsData:s}=O[l-1];const i=m*5;const o=s[i+1];const h=s[i+2];let _=s[i+3];let x=s[i+4];if(o>=0){const l=e[m];const O=s[i];const z=y-O;if(z>0){let e=o<v.length?v[o]:null;if(e===undefined){const t=B[o];e=t?r(t):null;v[o]=e}if(e!==null){const t=h<=e.length?e[h-1].slice(_,_+z):"";if(l.slice(0,z)===t){_+=z;x=-1}}}let k=o<A.length?A[o]:-2;if(k===-2){const[e,t]=o<M.length?M[o]:[null,undefined];let s=d.get(e);if(s===undefined){d.set(e,s=d.size);c(s,e,t)}k=s;A[o]=k}let L=-1;if(x>=0){L=x<C.length?C[x]:-2;if(L===-2){const e=x<b.length?b[x]:undefined;if(e){let t=p.get(e);if(t===undefined){p.set(e,t=p.size);a(t,e)}L=t}else{L=-1}C[x]=L}}else if(w>=0){let e=v[o];if(e===undefined){const t=B[o];e=t?r(t):null;v[o]=e}if(e!==null){const t=S[w];const s=h<=e.length?e[h-1].slice(_,_+t.length):"";if(t===s){L=w<g.length?g[w]:-2;if(L===-2){const e=S[w];if(e){let t=p.get(e);if(t===undefined){p.set(e,t=p.size);a(t,e)}L=t}else{L=-1}g[w]=L}}}}f(t,n,u,k,h,_,L);return}}if(o){f(t,n,u,-1,-1,-1,-1);return}else{if(_[h]===-2){let t=d.get(s);if(t===undefined){d.set(e,t=d.size);c(t,s,i)}_[h]=t}}}const x=h<0||h>=_.length?-1:_[h];if(x<0){f(t,n,u,-1,-1,-1,-1)}else{let e=-1;if(w>=0&&w<g.length){e=g[w];if(e===-2){const t=S[w];let s=p.get(t);if(s===undefined){p.set(t,s=p.size);a(s,t)}e=s;g[w]=e}}f(t,n,u,x,l,y,e)}}),((e,t,r)=>{if(t===s){m=e;if(i!==undefined)r=i;else i=r;_[e]=-2;n(r,u,((e,t,s,n,r,i,u)=>{while(O.length<t){O.push({mappingsData:[],chunks:[]})}const o=O[t-1];o.mappingsData.push(s,n,r,i,u);o.chunks.push(e)}),((e,t,s)=>{B[e]=s;v[e]=undefined;A[e]=-2;M[e]=[t,s]}),((e,t)=>{C[e]=-2;b[e]=t}),false,l)}else{let s=d.get(t);if(s===undefined){d.set(t,s=d.size);c(s,t,r)}_[e]=s}}),((e,t)=>{g[e]=-2;S[e]=t}),h,l)};e.exports=streamChunksOfCombinedSourceMap},951:(e,t,s)=>{"use strict";const n=s(151);const r=s(901);const streamChunksOfRawSource=(e,t,s,n)=>{let i=1;const u=r(e);let o;for(o of u){t(o,i,0,-1,-1,-1,-1);i++}return u.length===0||o.endsWith("\n")?{generatedLine:u.length+1,generatedColumn:0}:{generatedLine:u.length,generatedColumn:o.length}};e.exports=(e,t,s,r,i)=>i?n(e):streamChunksOfRawSource(e,t,s,r)},692:(e,t,s)=>{"use strict";const n=s(151);const r=s(634);const i=s(320);const u=s(901);const streamChunksOfSourceMapFull=(e,t,s,n,o)=>{const f=u(e);if(f.length===0){return{generatedLine:1,generatedColumn:0}}const{sources:c,sourcesContent:a,names:h,mappings:l}=t;for(let e=0;e<c.length;e++){n(e,r(t,e),a&&a[e]||undefined)}if(h){for(let e=0;e<h.length;e++){o(e,h[e])}}const d=f[f.length-1];const p=d.endsWith("\n");const _=p?f.length+1:f.length;const g=p?0:d.length;let S=1;let m=0;let A=false;let M=-1;let B=-1;let v=-1;let C=-1;const onMapping=(e,t,n,r,i,u)=>{if(A&&S<=f.length){let n;const r=S;const i=m;const u=f[S-1];if(e!==S){n=u.slice(m);S++;m=0}else{n=u.slice(m,t);m=t}if(n){s(n,r,i,M,B,v,C)}A=false}if(e>S&&m>0){if(S<=f.length){const e=f[S-1].slice(m);s(e,S,m,-1,-1,-1,-1)}S++;m=0}while(e>S){if(S<=f.length){s(f[S-1],S,0,-1,-1,-1,-1)}S++}if(t>m){if(S<=f.length){const e=f[S-1].slice(m,t);s(e,S,m,-1,-1,-1,-1)}m=t}if(n>=0&&(e<_||e===_&&t<g)){A=true;M=n;B=r;v=i;C=u}};i(l,onMapping);onMapping(_,g,-1,-1,-1,-1);return{generatedLine:_,generatedColumn:g}};const streamChunksOfSourceMapLinesFull=(e,t,s,n,o)=>{const f=u(e);if(f.length===0){return{generatedLine:1,generatedColumn:0}}const{sources:c,sourcesContent:a,mappings:h}=t;for(let e=0;e<c.length;e++){n(e,r(t,e),a&&a[e]||undefined)}let l=1;const onMapping=(e,t,n,r,i,u)=>{if(n<0||e<l||e>f.length){return}while(e>l){if(l<=f.length){s(f[l-1],l,0,-1,-1,-1,-1)}l++}if(e<=f.length){s(f[e-1],e,0,n,r,i,-1);l++}};i(h,onMapping);for(;l<=f.length;l++){s(f[l-1],l,0,-1,-1,-1,-1)}const d=f[f.length-1];const p=d.endsWith("\n");const _=p?f.length+1:f.length;const g=p?0:d.length;return{generatedLine:_,generatedColumn:g}};const streamChunksOfSourceMapFinal=(e,t,s,u,o)=>{const f=n(e);const{generatedLine:c,generatedColumn:a}=f;if(c===1&&a===0)return f;const{sources:h,sourcesContent:l,names:d,mappings:p}=t;for(let e=0;e<h.length;e++){u(e,r(t,e),l&&l[e]||undefined)}if(d){for(let e=0;e<d.length;e++){o(e,d[e])}}let _=0;const onMapping=(e,t,n,r,i,u)=>{if(e>=c&&(t>=a||e>c)){return}if(n>=0){s(undefined,e,t,n,r,i,u);_=e}else if(_===e){s(undefined,e,t,-1,-1,-1,-1);_=0}};i(p,onMapping);return f};const streamChunksOfSourceMapLinesFinal=(e,t,s,u,o)=>{const f=n(e);const{generatedLine:c,generatedColumn:a}=f;if(c===1&&a===0){return{generatedLine:1,generatedColumn:0}}const{sources:h,sourcesContent:l,mappings:d}=t;for(let e=0;e<h.length;e++){u(e,r(t,e),l&&l[e]||undefined)}const p=a===0?c-1:c;let _=1;const onMapping=(e,t,n,r,i,u)=>{if(n>=0&&_<=e&&e<=p){s(undefined,e,0,n,r,i,-1);_=e+1}};i(d,onMapping);return f};e.exports=(e,t,s,n,r,i,u)=>{if(u){return i?streamChunksOfSourceMapFinal(e,t,s,n,r):streamChunksOfSourceMapFull(e,t,s,n,r)}else{return i?streamChunksOfSourceMapLinesFinal(e,t,s,n,r):streamChunksOfSourceMapLinesFull(e,t,s,n,r)}}},794:(e,t,s)=>{const defineExport=(e,s)=>{let n;Object.defineProperty(t,e,{get:()=>{if(s!==undefined){n=s();s=undefined}return n},configurable:true})};defineExport("Source",(()=>s(799)));defineExport("RawSource",(()=>s(851)));defineExport("OriginalSource",(()=>s(297)));defineExport("SourceMapSource",(()=>s(890)));defineExport("CachedSource",(()=>s(209)));defineExport("ConcatSource",(()=>s(172)));defineExport("ReplaceSource",(()=>s(653)));defineExport("PrefixSource",(()=>s(516)));defineExport("SizeOnlySource",(()=>s(107)));defineExport("CompatSource",(()=>s(147)))}};var t={};function __nccwpck_require__(s){var n=t[s];if(n!==undefined){return n.exports}var r=t[s]={exports:{}};var i=true;try{e[s](r,r.exports,__nccwpck_require__);i=false}finally{if(i)delete t[s]}return r.exports}if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var s=__nccwpck_require__(794);module.exports=s})();
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2017 JS Foundation and other contributors
|
|
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.
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"name":"webpack-sources","author":"Tobias Koppers @sokra","version":"3.2.3","license":"MIT","types":"index.d.ts"}
|
package/dist/config/defaults.js
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var defaults_exports = {};
|
|
20
|
-
__export(defaults_exports, {
|
|
21
|
-
createDefaultConfig: () => createDefaultConfig,
|
|
22
|
-
withDefaultConfig: () => withDefaultConfig
|
|
23
|
-
});
|
|
24
|
-
module.exports = __toCommonJS(defaults_exports);
|
|
25
|
-
var import_shared = require("@rsbuild/shared");
|
|
26
|
-
const createDefaultConfig = () => ({
|
|
27
|
-
dev: (0, import_shared.getDefaultDevConfig)(),
|
|
28
|
-
server: (0, import_shared.getDefaultServerConfig)(),
|
|
29
|
-
html: (0, import_shared.getDefaultHtmlConfig)(),
|
|
30
|
-
tools: {
|
|
31
|
-
...(0, import_shared.getDefaultToolsConfig)(),
|
|
32
|
-
cssExtract: {
|
|
33
|
-
loaderOptions: {},
|
|
34
|
-
pluginOptions: {}
|
|
35
|
-
}
|
|
36
|
-
},
|
|
37
|
-
source: (0, import_shared.getDefaultSourceConfig)(),
|
|
38
|
-
output: (0, import_shared.getDefaultOutputConfig)(),
|
|
39
|
-
security: (0, import_shared.getDefaultSecurityConfig)(),
|
|
40
|
-
performance: (0, import_shared.getDefaultPerformanceConfig)()
|
|
41
|
-
});
|
|
42
|
-
const withDefaultConfig = (config) => (0, import_shared.mergeRsbuildConfig)(createDefaultConfig(), config);
|
|
43
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
44
|
-
0 && (module.exports = {
|
|
45
|
-
createDefaultConfig,
|
|
46
|
-
withDefaultConfig
|
|
47
|
-
});
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { RsbuildConfig, NormalizedConfig } from '../types';
|
|
2
|
-
/** #__PURE__
|
|
3
|
-
* 1. May used by multiple plugins.
|
|
4
|
-
* 2. Object value that should not be empty.
|
|
5
|
-
* 3. Meaningful and can be filled by constant value.
|
|
6
|
-
*/
|
|
7
|
-
export declare const normalizeConfig: (config: RsbuildConfig) => NormalizedConfig;
|
package/dist/config/normalize.js
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var normalize_exports = {};
|
|
20
|
-
__export(normalize_exports, {
|
|
21
|
-
normalizeConfig: () => normalizeConfig
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(normalize_exports);
|
|
24
|
-
var import_shared = require("@rsbuild/shared");
|
|
25
|
-
var import_defaults = require("./defaults");
|
|
26
|
-
const normalizeConfig = (config) => (0, import_shared.mergeRsbuildConfig)(
|
|
27
|
-
(0, import_defaults.createDefaultConfig)(),
|
|
28
|
-
config
|
|
29
|
-
);
|
|
30
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
31
|
-
0 && (module.exports = {
|
|
32
|
-
normalizeConfig
|
|
33
|
-
});
|
package/dist/core/build.d.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { InitConfigsOptions } from './initConfigs';
|
|
2
|
-
import { type Stats, type BuildOptions } from '@rsbuild/shared';
|
|
3
|
-
import type { MultiStats, Compiler, MultiCompiler } from 'webpack';
|
|
4
|
-
export interface BuildExecuter {
|
|
5
|
-
(compiler: Compiler): Promise<{
|
|
6
|
-
stats: Stats;
|
|
7
|
-
}>;
|
|
8
|
-
(compiler: MultiCompiler): Promise<{
|
|
9
|
-
stats: MultiStats;
|
|
10
|
-
}>;
|
|
11
|
-
(compiler: Compiler | MultiCompiler): Promise<{
|
|
12
|
-
stats: Stats | MultiStats;
|
|
13
|
-
}>;
|
|
14
|
-
}
|
|
15
|
-
export declare const webpackBuild: BuildExecuter;
|
|
16
|
-
export declare const build: (initOptions: InitConfigsOptions, {
|
|
17
|
-
mode,
|
|
18
|
-
watch,
|
|
19
|
-
compiler: customCompiler
|
|
20
|
-
}?: BuildOptions, executer?: BuildExecuter) => Promise<void>;
|
package/dist/core/build.js
DELETED
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var build_exports = {};
|
|
20
|
-
__export(build_exports, {
|
|
21
|
-
build: () => build,
|
|
22
|
-
webpackBuild: () => webpackBuild
|
|
23
|
-
});
|
|
24
|
-
module.exports = __toCommonJS(build_exports);
|
|
25
|
-
var import_createCompiler = require("./createCompiler");
|
|
26
|
-
var import_initConfigs = require("./initConfigs");
|
|
27
|
-
var import_shared = require("@rsbuild/shared");
|
|
28
|
-
const webpackBuild = async (compiler) => {
|
|
29
|
-
return new Promise((resolve, reject) => {
|
|
30
|
-
compiler.run((err, stats) => {
|
|
31
|
-
if (err || (stats == null ? void 0 : stats.hasErrors())) {
|
|
32
|
-
const buildError = err || new Error("Webpack build failed!");
|
|
33
|
-
reject(buildError);
|
|
34
|
-
} else {
|
|
35
|
-
compiler.close((closeErr) => {
|
|
36
|
-
closeErr && import_shared.logger.error(closeErr);
|
|
37
|
-
resolve({ stats });
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
});
|
|
41
|
-
});
|
|
42
|
-
};
|
|
43
|
-
const build = async (initOptions, { mode = "production", watch, compiler: customCompiler } = {}, executer) => {
|
|
44
|
-
if (!process.env.NODE_ENV) {
|
|
45
|
-
process.env.NODE_ENV = mode;
|
|
46
|
-
}
|
|
47
|
-
const { context } = initOptions;
|
|
48
|
-
let compiler;
|
|
49
|
-
let bundlerConfigs;
|
|
50
|
-
if (customCompiler) {
|
|
51
|
-
compiler = customCompiler;
|
|
52
|
-
} else {
|
|
53
|
-
const { webpackConfigs } = await (0, import_initConfigs.initConfigs)(initOptions);
|
|
54
|
-
compiler = await (0, import_createCompiler.createCompiler)({
|
|
55
|
-
context,
|
|
56
|
-
webpackConfigs
|
|
57
|
-
});
|
|
58
|
-
bundlerConfigs = webpackConfigs;
|
|
59
|
-
}
|
|
60
|
-
await context.hooks.onBeforeBuildHook.call({
|
|
61
|
-
bundlerConfigs
|
|
62
|
-
});
|
|
63
|
-
if (watch) {
|
|
64
|
-
compiler.watch({}, (err) => {
|
|
65
|
-
if (err) {
|
|
66
|
-
import_shared.logger.error(err);
|
|
67
|
-
}
|
|
68
|
-
});
|
|
69
|
-
} else {
|
|
70
|
-
const executeResult = await (executer == null ? void 0 : executer(compiler));
|
|
71
|
-
await context.hooks.onAfterBuildHook.call({
|
|
72
|
-
stats: executeResult == null ? void 0 : executeResult.stats
|
|
73
|
-
});
|
|
74
|
-
}
|
|
75
|
-
};
|
|
76
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
77
|
-
0 && (module.exports = {
|
|
78
|
-
build,
|
|
79
|
-
webpackBuild
|
|
80
|
-
});
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { Context, WebpackConfig } from '../types';
|
|
2
|
-
import { InitConfigsOptions } from './initConfigs';
|
|
3
|
-
import type { Compiler, MultiCompiler } from 'webpack';
|
|
4
|
-
export declare function createCompiler({
|
|
5
|
-
context,
|
|
6
|
-
webpackConfigs
|
|
7
|
-
}: {
|
|
8
|
-
context: Context;
|
|
9
|
-
webpackConfigs: WebpackConfig[];
|
|
10
|
-
}): Promise<Compiler | MultiCompiler>;
|
|
11
|
-
export declare function createDevMiddleware(options: InitConfigsOptions, customCompiler?: Compiler | MultiCompiler): Promise<{
|
|
12
|
-
devMiddleware: import("@rsbuild/shared").DevMiddleware;
|
|
13
|
-
compiler: Compiler | MultiCompiler;
|
|
14
|
-
}>;
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
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
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var createCompiler_exports = {};
|
|
30
|
-
__export(createCompiler_exports, {
|
|
31
|
-
createCompiler: () => createCompiler,
|
|
32
|
-
createDevMiddleware: () => createDevMiddleware
|
|
33
|
-
});
|
|
34
|
-
module.exports = __toCommonJS(createCompiler_exports);
|
|
35
|
-
var import_shared = require("@rsbuild/shared");
|
|
36
|
-
var import_initConfigs = require("./initConfigs");
|
|
37
|
-
var import_devMiddleware = require("./devMiddleware");
|
|
38
|
-
async function createCompiler({
|
|
39
|
-
context,
|
|
40
|
-
webpackConfigs
|
|
41
|
-
}) {
|
|
42
|
-
(0, import_shared.debug)("create compiler");
|
|
43
|
-
await context.hooks.onBeforeCreateCompilerHook.call({
|
|
44
|
-
bundlerConfigs: webpackConfigs
|
|
45
|
-
});
|
|
46
|
-
const { default: webpack } = await Promise.resolve().then(() => __toESM(require("webpack")));
|
|
47
|
-
const compiler = webpackConfigs.length === 1 ? webpack(webpackConfigs[0]) : webpack(webpackConfigs);
|
|
48
|
-
let isFirstCompile = true;
|
|
49
|
-
compiler.hooks.done.tap("rsbuild:done", async (stats) => {
|
|
50
|
-
const { message, level } = (0, import_shared.formatStats)(stats);
|
|
51
|
-
if (level === "error") {
|
|
52
|
-
import_shared.logger.error(message);
|
|
53
|
-
}
|
|
54
|
-
if (level === "warning") {
|
|
55
|
-
import_shared.logger.warn(message);
|
|
56
|
-
}
|
|
57
|
-
if ((0, import_shared.isDev)()) {
|
|
58
|
-
await context.hooks.onDevCompileDoneHook.call({
|
|
59
|
-
isFirstCompile
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
isFirstCompile = false;
|
|
63
|
-
});
|
|
64
|
-
await context.hooks.onAfterCreateCompilerHook.call({ compiler });
|
|
65
|
-
(0, import_shared.debug)("create compiler done");
|
|
66
|
-
return compiler;
|
|
67
|
-
}
|
|
68
|
-
async function createDevMiddleware(options, customCompiler) {
|
|
69
|
-
let compiler;
|
|
70
|
-
if (customCompiler) {
|
|
71
|
-
compiler = customCompiler;
|
|
72
|
-
} else {
|
|
73
|
-
const { webpackConfigs } = await (0, import_initConfigs.initConfigs)(options);
|
|
74
|
-
compiler = await createCompiler({
|
|
75
|
-
context: options.context,
|
|
76
|
-
webpackConfigs
|
|
77
|
-
});
|
|
78
|
-
}
|
|
79
|
-
return {
|
|
80
|
-
devMiddleware: (0, import_devMiddleware.getDevMiddleware)(compiler),
|
|
81
|
-
compiler
|
|
82
|
-
};
|
|
83
|
-
}
|
|
84
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
85
|
-
0 && (module.exports = {
|
|
86
|
-
createCompiler,
|
|
87
|
-
createDevMiddleware
|
|
88
|
-
});
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { type CreateRsbuildOptions } from '@rsbuild/shared';
|
|
2
|
-
import type { Context, RsbuildConfig } from '../types';
|
|
3
|
-
/**
|
|
4
|
-
* Create primary context.
|
|
5
|
-
* It will be assembled into a normal context or a stub for testing as needed.
|
|
6
|
-
* Usually it would be a pure function
|
|
7
|
-
*/
|
|
8
|
-
export declare function createPrimaryContext(options: Required<CreateRsbuildOptions>, userRsbuildConfig: RsbuildConfig): Context;
|
|
9
|
-
/**
|
|
10
|
-
* Generate the actual context used in the build,
|
|
11
|
-
* which can have a lot of overhead and take some side effects.
|
|
12
|
-
*/
|
|
13
|
-
export declare function createContext(options: Required<CreateRsbuildOptions>, rsbuildConfig: RsbuildConfig): Promise<Context>;
|