@umijs/bundler-webpack 4.0.0-beta.9 → 4.0.0-canary-20240513.3

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.
Files changed (260) hide show
  1. package/client/client/client.js +255 -167
  2. package/client/constants.d.ts +15 -0
  3. package/client/constants.js +30 -12
  4. package/client/utils/formatWebpackMessages.d.ts +12 -0
  5. package/client/utils/formatWebpackMessages.js +87 -86
  6. package/compiled/autoprefixer/browserslist/index.d.ts +33 -7
  7. package/compiled/autoprefixer/index.js +3 -3
  8. package/compiled/autoprefixer/package.json +1 -1
  9. package/compiled/autoprefixer/postcss/lib/at-rule.d.ts +1 -1
  10. package/compiled/autoprefixer/postcss/lib/comment.d.ts +1 -1
  11. package/compiled/autoprefixer/postcss/lib/container.d.ts +2 -2
  12. package/compiled/autoprefixer/postcss/lib/css-syntax-error.d.ts +55 -8
  13. package/compiled/autoprefixer/postcss/lib/declaration.d.ts +2 -2
  14. package/compiled/autoprefixer/postcss/lib/input.d.ts +26 -6
  15. package/compiled/autoprefixer/postcss/lib/lazy-result.d.ts +11 -10
  16. package/compiled/autoprefixer/postcss/lib/no-work-result.d.ts +37 -0
  17. package/compiled/autoprefixer/postcss/lib/node.d.ts +38 -4
  18. package/compiled/autoprefixer/postcss/lib/postcss.d.ts +31 -30
  19. package/compiled/autoprefixer/postcss/lib/processor.d.ts +6 -5
  20. package/compiled/autoprefixer/postcss/lib/result.d.ts +3 -2
  21. package/compiled/autoprefixer/postcss/lib/rule.d.ts +1 -1
  22. package/compiled/autoprefixer/postcss/lib/warning.d.ts +37 -3
  23. package/compiled/autoprefixer/source-map-js/source-map.d.ts +99 -82
  24. package/compiled/babel-loader/index.js +8 -2
  25. package/compiled/babel-loader/package.json +1 -1
  26. package/compiled/copy-webpack-plugin/939.index.js +1171 -0
  27. package/compiled/copy-webpack-plugin/index.js +16 -10
  28. package/compiled/copy-webpack-plugin/package.json +1 -1
  29. package/compiled/css-minimizer-webpack-plugin/index.js +8 -2
  30. package/compiled/css-minimizer-webpack-plugin/minify.js +23 -22
  31. package/compiled/css-minimizer-webpack-plugin/package.json +1 -1
  32. package/compiled/css-minimizer-webpack-plugin/utils.js +305 -54
  33. package/compiled/cssnano/index.js +12 -11
  34. package/compiled/cssnano/package.json +1 -1
  35. package/compiled/express.d.ts +2 -0
  36. package/compiled/file-loader/index.js +3 -0
  37. package/compiled/file-loader/package.json +1 -0
  38. package/compiled/less-loader/index.js +1 -1
  39. package/compiled/less-loader/package.json +1 -1
  40. package/compiled/mini-css-extract-plugin/hmr/hotModuleReplacement.js +60 -46
  41. package/compiled/mini-css-extract-plugin/hmr/normalize-url.js +10 -6
  42. package/compiled/mini-css-extract-plugin/index.js +10669 -10348
  43. package/compiled/mini-css-extract-plugin/loader.js +159 -100
  44. package/compiled/mini-css-extract-plugin/package.json +1 -1
  45. package/compiled/mini-css-extract-plugin/utils.js +88 -44
  46. package/compiled/postcss-loader/index.js +1 -1
  47. package/compiled/postcss-loader/package.json +1 -1
  48. package/compiled/sass-loader/index.js +1 -1
  49. package/compiled/sass-loader/package.json +1 -1
  50. package/compiled/sass-loader/sass.default.dart.js +4 -0
  51. package/compiled/schema-utils/ajv/dist/ajv.d.ts +16 -0
  52. package/compiled/schema-utils/ajv/dist/compile/codegen/code.d.ts +39 -0
  53. package/compiled/schema-utils/ajv/dist/compile/codegen/index.d.ts +79 -0
  54. package/compiled/schema-utils/ajv/dist/compile/codegen/scope.d.ts +79 -0
  55. package/compiled/schema-utils/ajv/dist/compile/errors.d.ts +13 -0
  56. package/compiled/schema-utils/ajv/dist/compile/index.d.ts +80 -0
  57. package/compiled/schema-utils/ajv/dist/compile/ref_error.d.ts +5 -0
  58. package/compiled/schema-utils/ajv/dist/compile/resolve.d.ts +12 -0
  59. package/compiled/schema-utils/ajv/dist/compile/rules.d.ts +28 -0
  60. package/compiled/schema-utils/ajv/dist/compile/util.d.ts +40 -0
  61. package/compiled/schema-utils/ajv/dist/compile/validate/index.d.ts +42 -0
  62. package/compiled/schema-utils/ajv/dist/compile/validate/subschema.d.ts +47 -0
  63. package/compiled/schema-utils/ajv/dist/core.d.ts +171 -0
  64. package/compiled/schema-utils/ajv/dist/runtime/validation_error.d.ts +7 -0
  65. package/compiled/schema-utils/ajv/dist/types/index.d.ts +177 -0
  66. package/compiled/schema-utils/ajv/dist/types/json-schema.d.ts +124 -0
  67. package/compiled/schema-utils/ajv/dist/types/jtd-schema.d.ts +168 -0
  68. package/compiled/schema-utils/declarations/validate.d.ts +4 -4
  69. package/compiled/schema-utils/index.js +8 -2
  70. package/compiled/schema-utils/uri-js/dist/es5/uri.all.d.ts +59 -0
  71. package/compiled/style-loader/index.js +1 -1
  72. package/compiled/stylus-loader/LICENSE +20 -0
  73. package/compiled/stylus-loader/index.js +44 -0
  74. package/compiled/stylus-loader/package.json +1 -0
  75. package/compiled/terser/@jridgewell/gen-mapping/dist/types/gen-mapping.d.ts +90 -0
  76. package/compiled/terser/@jridgewell/gen-mapping/dist/types/sourcemap-segment.d.ts +12 -0
  77. package/compiled/terser/@jridgewell/gen-mapping/dist/types/types.d.ts +35 -0
  78. package/compiled/terser/@jridgewell/source-map/dist/types/source-map.d.ts +25 -0
  79. package/compiled/terser/@jridgewell/trace-mapping/dist/types/sourcemap-segment.d.ts +16 -0
  80. package/compiled/terser/@jridgewell/trace-mapping/dist/types/trace-mapping.d.ts +74 -0
  81. package/compiled/terser/@jridgewell/trace-mapping/dist/types/types.d.ts +92 -0
  82. package/compiled/terser/index.js +1 -1
  83. package/compiled/terser/package.json +1 -1
  84. package/compiled/terser/tools/terser.d.ts +6 -3
  85. package/compiled/terser-webpack-plugin/@jridgewell/trace-mapping/dist/types/sourcemap-segment.d.ts +16 -0
  86. package/compiled/terser-webpack-plugin/@jridgewell/trace-mapping/dist/types/trace-mapping.d.ts +74 -0
  87. package/compiled/terser-webpack-plugin/@jridgewell/trace-mapping/dist/types/types.d.ts +92 -0
  88. package/compiled/terser-webpack-plugin/index.js +1390 -3693
  89. package/compiled/terser-webpack-plugin/jest-worker/build/types.d.ts +1 -0
  90. package/compiled/terser-webpack-plugin/minify.js +10 -3
  91. package/compiled/terser-webpack-plugin/package.json +1 -1
  92. package/compiled/terser-webpack-plugin/types/index.d.ts +186 -152
  93. package/compiled/terser-webpack-plugin/types/minify.d.ts +17 -0
  94. package/compiled/terser-webpack-plugin/types/utils.d.ts +20 -24
  95. package/compiled/terser-webpack-plugin/utils.js +153 -34
  96. package/compiled/webpack/BasicEffectRulePlugin.js +1 -0
  97. package/compiled/webpack/BasicEvaluatedExpression.js +1 -0
  98. package/compiled/webpack/BasicMatcherRulePlugin.js +1 -0
  99. package/compiled/webpack/ExternalsPlugin.js +1 -0
  100. package/compiled/webpack/FetchCompileAsyncWasmPlugin.js +1 -0
  101. package/compiled/webpack/FetchCompileWasmPlugin.js +1 -0
  102. package/compiled/webpack/HotModuleReplacement.runtime.js +29 -14
  103. package/compiled/webpack/JavascriptHotModuleReplacement.runtime.js +4 -3
  104. package/compiled/webpack/LimitChunkCountPlugin.js +1 -0
  105. package/compiled/webpack/NodeTargetPlugin.js +1 -0
  106. package/compiled/webpack/NodeTemplatePlugin.js +1 -0
  107. package/compiled/webpack/ObjectMatcherRulePlugin.js +1 -0
  108. package/compiled/webpack/RuleSetCompiler.js +1 -0
  109. package/compiled/webpack/StringXor.js +1 -0
  110. package/compiled/webpack/UseEffectRulePlugin.js +1 -0
  111. package/compiled/webpack/WebWorkerTemplatePlugin.js +1 -0
  112. package/compiled/webpack/deepImports.json +15 -1
  113. package/compiled/webpack/index.js +26404 -10329
  114. package/compiled/webpack/json-schema/index.d.ts +8 -1
  115. package/compiled/webpack/lazy-compilation-node.js +10 -0
  116. package/compiled/webpack/lazy-compilation-web.js +9 -0
  117. package/compiled/webpack/types.d.ts +823 -287
  118. package/compiled/webpack-5-chain/index.js +1 -1
  119. package/compiled/webpack-5-chain/package.json +1 -1
  120. package/compiled/webpack-5-chain/types/index.d.ts +76 -20
  121. package/compiled/webpack-bundle-analyzer/index.js +7 -6
  122. package/compiled/webpack-bundle-analyzer/package.json +1 -1
  123. package/compiled/webpack-bundle-analyzer/public/viewer.js +2 -2
  124. package/compiled/webpack-bundle-analyzer/public/viewer.js.map +1 -1
  125. package/compiled/webpack-dev-middleware/index.js +12 -5
  126. package/compiled/webpack-dev-middleware/package.json +1 -1
  127. package/compiled/{tapable → webpack-manifest-plugin}/LICENSE +2 -2
  128. package/compiled/webpack-manifest-plugin/index.js +1 -0
  129. package/compiled/webpack-manifest-plugin/package.json +1 -0
  130. package/compiled/webpack-sources/index.js +1 -1
  131. package/compiled/{express → webpackbar}/LICENSE +1 -5
  132. package/compiled/webpackbar/dist/index.d.ts +121 -0
  133. package/compiled/webpackbar/index.js +7 -0
  134. package/compiled/webpackbar/package.json +1 -0
  135. package/compiled/ws/LICENSE +13 -12
  136. package/compiled/ws/index.d.ts +74 -35
  137. package/compiled/ws/index.js +1 -1
  138. package/compiled/ws/package.json +1 -1
  139. package/dist/build.d.ts +8 -3
  140. package/dist/build.js +147 -68
  141. package/dist/cli.js +84 -81
  142. package/dist/config/_sampleFeature.js +33 -20
  143. package/dist/config/assetRules.js +46 -67
  144. package/dist/config/bundleAnalyzerPlugin.js +41 -28
  145. package/dist/config/compressPlugin.js +125 -74
  146. package/dist/config/config.d.ts +11 -2
  147. package/dist/config/config.js +235 -172
  148. package/dist/config/copyPlugin.js +61 -47
  149. package/dist/config/cssRules.js +162 -95
  150. package/dist/config/definePlugin.d.ts +2 -0
  151. package/dist/config/definePlugin.js +59 -39
  152. package/dist/config/detectCssModulesInDependence.d.ts +10 -0
  153. package/dist/config/detectCssModulesInDependence.js +151 -0
  154. package/dist/config/detectDeadCode.d.ts +12 -0
  155. package/dist/config/detectDeadCode.js +191 -0
  156. package/dist/config/detectDeadCodePlugin.d.ts +9 -0
  157. package/dist/config/detectDeadCodePlugin.js +82 -0
  158. package/dist/config/fastRefreshPlugin.js +46 -31
  159. package/dist/config/forkTSCheckerPlugin.d.ts +11 -0
  160. package/dist/config/forkTSCheckerPlugin.js +49 -0
  161. package/dist/config/harmonyLinkingErrorPlugin.d.ts +6 -0
  162. package/dist/config/harmonyLinkingErrorPlugin.js +53 -0
  163. package/dist/config/ignorePlugin.js +38 -25
  164. package/dist/config/javaScriptRules.d.ts +2 -0
  165. package/dist/config/javaScriptRules.js +186 -150
  166. package/dist/config/manifestPlugin.d.ts +11 -0
  167. package/dist/config/manifestPlugin.js +40 -0
  168. package/dist/config/miniCSSExtractPlugin.d.ts +1 -0
  169. package/dist/config/miniCSSExtractPlugin.js +52 -31
  170. package/dist/config/nodePolyfill.js +49 -32
  171. package/dist/config/nodePrefixPlugin.d.ts +11 -0
  172. package/dist/config/nodePrefixPlugin.js +38 -0
  173. package/dist/config/progressPlugin.js +50 -24
  174. package/dist/config/purgecssWebpackPlugin.js +41 -30
  175. package/dist/config/speedMeasureWebpackPlugin.js +56 -31
  176. package/dist/config/ssrPlugin.d.ts +11 -0
  177. package/dist/config/ssrPlugin.js +98 -0
  178. package/dist/config/svgRules.d.ts +1 -0
  179. package/dist/config/svgRules.js +68 -41
  180. package/dist/constants.d.ts +4 -0
  181. package/dist/constants.js +59 -15
  182. package/dist/dev.d.ts +23 -2
  183. package/dist/dev.js +198 -81
  184. package/dist/index.d.ts +6 -1
  185. package/dist/index.js +31 -15
  186. package/dist/loader/svgr.d.ts +4 -0
  187. package/dist/loader/svgr.js +84 -0
  188. package/dist/loader/swc.d.ts +4 -0
  189. package/dist/loader/swc.js +149 -0
  190. package/dist/parcelCSS.d.ts +2 -0
  191. package/dist/parcelCSS.js +39 -0
  192. package/dist/plugins/EsbuildMinifyFix.d.ts +8 -0
  193. package/dist/plugins/EsbuildMinifyFix.js +136 -0
  194. package/dist/plugins/ProgressPlugin.js +68 -43
  195. package/dist/plugins/RuntimePublicPathPlugin.d.ts +4 -0
  196. package/dist/plugins/RuntimePublicPathPlugin.js +45 -0
  197. package/dist/plugins/_SamplePlugin.d.ts +1 -1
  198. package/dist/plugins/_SamplePlugin.js +37 -14
  199. package/dist/requireHook.js +44 -27
  200. package/dist/schema.d.ts +4 -3
  201. package/dist/schema.js +175 -69
  202. package/dist/server/server.d.ts +4 -3
  203. package/dist/server/server.js +219 -154
  204. package/dist/server/ws.d.ts +8 -3
  205. package/dist/server/ws.js +72 -38
  206. package/dist/swcPlugins/autoCSSModules.d.ts +11 -2
  207. package/dist/swcPlugins/autoCSSModules.js +60 -32
  208. package/dist/swcPlugins/changeImportFromString.d.ts +2 -0
  209. package/dist/swcPlugins/changeImportFromString.js +32 -0
  210. package/dist/swcPlugins/lockCoreJS.d.ts +6 -0
  211. package/dist/swcPlugins/lockCoreJS.js +56 -0
  212. package/dist/types.d.ts +53 -9
  213. package/dist/types.js +61 -29
  214. package/dist/utils/browsersList.js +31 -8
  215. package/dist/utils/depMatch.js +65 -39
  216. package/dist/utils/formatWebpackMessages.js +119 -91
  217. package/dist/utils/getEsBuildTarget.d.ts +7 -0
  218. package/dist/utils/getEsBuildTarget.js +46 -0
  219. package/dist/utils/pkgUpContainsName.d.ts +1 -0
  220. package/dist/utils/pkgUpContainsName.js +50 -0
  221. package/package.json +76 -68
  222. package/compiled/@svgr/webpack/LICENSE +0 -7
  223. package/compiled/@svgr/webpack/index.js +0 -266
  224. package/compiled/@svgr/webpack/package.json +0 -1
  225. package/compiled/css-loader/api.js +0 -102
  226. package/compiled/css-loader/getUrl.js +0 -29
  227. package/compiled/css-loader/index.js +0 -2
  228. package/compiled/css-loader/noSourceMaps.js +0 -5
  229. package/compiled/css-loader/package.json +0 -1
  230. package/compiled/css-loader/sourceMaps.js +0 -22
  231. package/compiled/express/body-parser/index.d.ts +0 -104
  232. package/compiled/express/connect/index.d.ts +0 -93
  233. package/compiled/express/express-serve-static-core/index.d.ts +0 -1252
  234. package/compiled/express/index.d.ts +0 -133
  235. package/compiled/express/index.js +0 -338
  236. package/compiled/express/mime/index.d.ts +0 -35
  237. package/compiled/express/package.json +0 -1
  238. package/compiled/express/qs/index.d.ts +0 -62
  239. package/compiled/express/range-parser/index.d.ts +0 -35
  240. package/compiled/express/serve-static/index.d.ts +0 -108
  241. package/compiled/http-proxy-middleware/LICENSE +0 -22
  242. package/compiled/http-proxy-middleware/dist/index.d.ts +0 -4
  243. package/compiled/http-proxy-middleware/dist/types.d.ts +0 -54
  244. package/compiled/http-proxy-middleware/http-proxy/index.d.ts +0 -226
  245. package/compiled/http-proxy-middleware/index.js +0 -66
  246. package/compiled/http-proxy-middleware/package.json +0 -1
  247. package/compiled/less/index.js +0 -31
  248. package/compiled/less/package.json +0 -1
  249. package/compiled/react-refresh/index.js +0 -19
  250. package/compiled/swc-loader/LICENSE +0 -25
  251. package/compiled/swc-loader/index.js +0 -1
  252. package/compiled/swc-loader/package.json +0 -1
  253. package/compiled/tapable/index.js +0 -1
  254. package/compiled/tapable/package.json +0 -1
  255. package/compiled/tapable/tapable.d.ts +0 -116
  256. package/dist/client/client.js +0 -239
  257. package/dist/plugins/ESBuildCSSMinifyPlugin.d.ts +0 -11
  258. package/dist/plugins/ESBuildCSSMinifyPlugin.js +0 -65
  259. /package/{dist → client}/client/client.d.ts +0 -0
  260. /package/compiled/{css-loader → file-loader}/LICENSE +0 -0
@@ -0,0 +1 @@
1
+ {"name":"file-loader","version":"6.2.0","author":"Tobias Koppers @sokra","license":"MIT"}
@@ -1 +1 @@
1
- (function(){var e={937:function(e,t){function set(e,t,r){if(typeof r.value==="object")r.value=klona(r.value);if(!r.enumerable||r.get||r.set||!r.configurable||!r.writable||t==="__proto__"){Object.defineProperty(e,t,r)}else e[t]=r.value}function klona(e){if(typeof e!=="object")return e;var t=0,r,n,s,o=Object.prototype.toString.call(e);if(o==="[object Object]"){s=Object.create(e.__proto__||null)}else if(o==="[object Array]"){s=Array(e.length)}else if(o==="[object Set]"){s=new Set;e.forEach((function(e){s.add(klona(e))}))}else if(o==="[object Map]"){s=new Map;e.forEach((function(e,t){s.set(klona(t),klona(e))}))}else if(o==="[object Date]"){s=new Date(+e)}else if(o==="[object RegExp]"){s=new RegExp(e.source,e.flags)}else if(o==="[object DataView]"){s=new e.constructor(klona(e.buffer))}else if(o==="[object ArrayBuffer]"){s=e.slice(0)}else if(o.slice(-6)==="Array]"){s=new e.constructor(e)}if(s){for(n=Object.getOwnPropertySymbols(e);t<n.length;t++){set(s,n[t],Object.getOwnPropertyDescriptor(e,n[t]))}for(t=0,n=Object.getOwnPropertyNames(e);t<n.length;t++){if(Object.hasOwnProperty.call(s,r=n[t])&&s[r]===e[r])continue;set(s,r,Object.getOwnPropertyDescriptor(e,r))}}return s||e}t.klona=klona},669:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.default=void 0;var n=_interopRequireDefault(r(622));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}class LessError extends Error{constructor(e){super();this.message=["\n",...LessError.getFileExcerptIfPossible(e),e.message.charAt(0).toUpperCase()+e.message.slice(1),e.filename?` Error in ${n.default.normalize(e.filename)} (line ${e.line}, column ${e.column})`:""].join("\n");this.hideStack=true}static getFileExcerptIfPossible(e){if(typeof e.extract==="undefined"){return[]}const t=e.extract.slice(0,2);const r=Math.max(e.column-1,0);if(typeof t[0]==="undefined"){t.shift()}t.push(`${new Array(r).join(" ")}^`);return t}}var s=LessError;t.default=s},988:function(e,t,r){"use strict";e.exports=r(805).default},805:function(e,t,r){"use strict";var n;n={value:true};t.default=void 0;var s=_interopRequireDefault(r(622));var o=_interopRequireDefault(r(359));var i=r(697);var a=_interopRequireDefault(r(669));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}async function lessLoader(e){const t=this.getOptions(o.default);const r=this.async();const n=(0,i.getLessImplementation)(this,t.implementation);if(!n){r(new Error(`The Less implementation "${t.implementation}" not found`));return}const l=(0,i.getLessOptions)(this,t,n);const c=typeof t.sourceMap==="boolean"?t.sourceMap:this.sourceMap;if(c){l.sourceMap={outputSourceFiles:true}}let u=e;if(typeof t.additionalData!=="undefined"){u=typeof t.additionalData==="function"?`${await t.additionalData(u,this)}`:`${t.additionalData}\n${u}`}const p=this.getLogger("less-loader");const f={error(e){p.error(e)},warn(e){p.warn(e)},info(e){p.log(e)},debug(e){p.debug(e)}};n.logger.addListener(f);let d;try{d=await n.render(u,l)}catch(e){if(e.filename){this.addDependency(s.default.normalize(e.filename))}r(new a.default(e));return}finally{n.logger.removeListener(f);delete l.pluginManager.webpackLoaderContext;delete l.pluginManager}const{css:m,imports:b}=d;b.forEach((e=>{if((0,i.isUnsupportedUrl)(e)){return}const t=s.default.normalize(e);if(s.default.isAbsolute(t)){this.addDependency(t)}}));let g=typeof d.map==="string"?JSON.parse(d.map):d.map;if(g&&c){g=(0,i.normalizeSourceMap)(g,this.rootContext)}r(null,m,g)}var l=lessLoader;t.default=l},697:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.getLessImplementation=getLessImplementation;t.getLessOptions=getLessOptions;t.isUnsupportedUrl=isUnsupportedUrl;t.normalizeSourceMap=normalizeSourceMap;var n=_interopRequireDefault(r(622));var s=r(937);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}const o=/[/\\]$/;const i=/^~[^/]+$/;const a=/^[a-z]:[/\\]|^\\\\/i;const l=/^~([^/]+|[^/]+\/|@[^/]+[/][^/]+|@[^/]+\/?|@[^/]+[/][^/]+\/)$/;const c=/^[^?]*~/;function createWebpackLessPlugin(e,t){const r=e.getResolve({dependencyType:"less",conditionNames:["less","style"],mainFields:["less","style","main","..."],mainFiles:["index","..."],extensions:[".less",".css"],preferRelative:true});class WebpackFileManager extends t.FileManager{supports(e){if(e[0]==="/"||a.test(e)){return true}if(this.isPathAbsolute(e)){return false}return true}supportsSync(){return false}async resolveFilename(e,t){const r=t.replace(o,"");let n=e;if(c.test(e)){n=n.replace(c,"")}if(l.test(e)){n=n[n.length-1]==="/"?n:`${n}/`}return this.resolveRequests(r,[...new Set([n,e])])}async resolveRequests(e,t){if(t.length===0){return Promise.reject()}let n;try{n=await r(e,t[0])}catch(r){const[,...s]=t;if(s.length===0){throw r}n=await this.resolveRequests(e,s)}return n}async loadFile(t,...r){let s;try{if(i.test(t)){const e=new Error;e.type="Next";throw e}s=await super.loadFile(t,...r)}catch(n){if(n.type!=="File"&&n.type!=="Next"){return Promise.reject(n)}try{s=await this.resolveFilename(t,...r)}catch(e){n.message=`Less resolver error:\n${n.message}\n\n`+`Webpack resolver error details:\n${e.details}\n\n`+`Webpack resolver error missing:\n${e.missing}\n\n`;return Promise.reject(n)}e.addDependency(s);return super.loadFile(s,...r)}e.addDependency(n.default.normalize(s.filename));return s}}return{install(e,t){t.addFileManager(new WebpackFileManager)},minVersion:[3,0,0]}}function getLessOptions(e,t,r){const n=(0,s.klona)(typeof t.lessOptions==="function"?t.lessOptions(e)||{}:t.lessOptions||{});const o={plugins:[],relativeUrls:true,filename:e.resourcePath,...n};const i=typeof t.webpackImporter==="boolean"?t.webpackImporter:true;if(i){o.plugins.unshift(createWebpackLessPlugin(e,r))}o.plugins.unshift({install(t,r){r.webpackLoaderContext=e;o.pluginManager=r}});return o}function isUnsupportedUrl(e){if(a.test(e)){return false}return/^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(e)}function normalizeSourceMap(e){const t=e;delete t.file;t.sourceRoot="";t.sources=t.sources.map((e=>n.default.normalize(e)));return t}function getLessImplementation(e,t){let r=t;if(!t||typeof t==="string"){const n=t||"less";try{r=require(n)}catch(t){e.emitError(t);return}}return r}},359:function(e){"use strict";e.exports=JSON.parse('{"title":"Less Loader options","type":"object","properties":{"lessOptions":{"description":"Options to pass through to `Less`.","link":"https://github.com/webpack-contrib/less-loader#lessoptions","anyOf":[{"type":"object","additionalProperties":true},{"instanceof":"Function"}]},"additionalData":{"description":"Prepends/Appends `Less` code to the actual entry file.","link":"https://github.com/webpack-contrib/less-loader#additionalData","anyOf":[{"type":"string"},{"instanceof":"Function"}]},"sourceMap":{"description":"Enables/Disables generation of source maps.","link":"https://github.com/webpack-contrib/less-loader#sourcemap","type":"boolean"},"webpackImporter":{"description":"Enables/Disables default `webpack` importer.","link":"https://github.com/webpack-contrib/less-loader#webpackimporter","type":"boolean"},"implementation":{"description":"The implementation of the `Less` to be used.","link":"https://github.com/webpack-contrib/less-loader#implementation","anyOf":[{"type":"string"},{"type":"object"}]}},"additionalProperties":false}')},622:function(e){"use strict";e.exports=require("path")}};var t={};function __nccwpck_require__(r){var n=t[r];if(n!==undefined){return n.exports}var s=t[r]={exports:{}};var o=true;try{e[r](s,s.exports,__nccwpck_require__);o=false}finally{if(o)delete t[r]}return s.exports}if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var r=__nccwpck_require__(988);module.exports=r})();
1
+ (function(){var e={195:function(e,t){function set(e,t,r){if(typeof r.value==="object")r.value=klona(r.value);if(!r.enumerable||r.get||r.set||!r.configurable||!r.writable||t==="__proto__"){Object.defineProperty(e,t,r)}else e[t]=r.value}function klona(e){if(typeof e!=="object")return e;var t=0,r,n,s,o=Object.prototype.toString.call(e);if(o==="[object Object]"){s=Object.create(e.__proto__||null)}else if(o==="[object Array]"){s=Array(e.length)}else if(o==="[object Set]"){s=new Set;e.forEach((function(e){s.add(klona(e))}))}else if(o==="[object Map]"){s=new Map;e.forEach((function(e,t){s.set(klona(t),klona(e))}))}else if(o==="[object Date]"){s=new Date(+e)}else if(o==="[object RegExp]"){s=new RegExp(e.source,e.flags)}else if(o==="[object DataView]"){s=new e.constructor(klona(e.buffer))}else if(o==="[object ArrayBuffer]"){s=e.slice(0)}else if(o.slice(-6)==="Array]"){s=new e.constructor(e)}if(s){for(n=Object.getOwnPropertySymbols(e);t<n.length;t++){set(s,n[t],Object.getOwnPropertyDescriptor(e,n[t]))}for(t=0,n=Object.getOwnPropertyNames(e);t<n.length;t++){if(Object.hasOwnProperty.call(s,r=n[t])&&s[r]===e[r])continue;set(s,r,Object.getOwnPropertyDescriptor(e,r))}}return s||e}t.klona=klona},154:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});t["default"]=void 0;var n=_interopRequireDefault(r(17));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}class LessError extends Error{constructor(e){super();this.message=["\n",...LessError.getFileExcerptIfPossible(e),e.message.charAt(0).toUpperCase()+e.message.slice(1),e.filename?` Error in ${n.default.normalize(e.filename)} (line ${e.line}, column ${e.column})`:""].join("\n");this.hideStack=true}static getFileExcerptIfPossible(e){if(typeof e.extract==="undefined"){return[]}const t=e.extract.slice(0,2);const r=Math.max(e.column-1,0);if(typeof t[0]==="undefined"){t.shift()}t.push(`${new Array(r).join(" ")}^`);return t}}var s=LessError;t["default"]=s},100:function(e,t,r){"use strict";e.exports=r(94)["default"]},94:function(e,t,r){"use strict";var n;n={value:true};t["default"]=void 0;var s=_interopRequireDefault(r(17));var o=_interopRequireDefault(r(305));var i=r(196);var a=_interopRequireDefault(r(154));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}async function lessLoader(e){const t=this.getOptions(o.default);const r=this.async();const n=(0,i.getLessImplementation)(this,t.implementation);if(!n){r(new Error(`The Less implementation "${t.implementation}" not found`));return}const l=(0,i.getLessOptions)(this,t,n);const c=typeof t.sourceMap==="boolean"?t.sourceMap:this.sourceMap;if(c){l.sourceMap={outputSourceFiles:true}}let u=e;if(typeof t.additionalData!=="undefined"){u=typeof t.additionalData==="function"?`${await t.additionalData(u,this)}`:`${t.additionalData}\n${u}`}const p=this.getLogger("less-loader");const f={error(e){p.error(e)},warn(e){p.warn(e)},info(e){p.log(e)},debug(e){p.debug(e)}};n.logger.addListener(f);let d;try{d=await n.render(u,l)}catch(e){if(e.filename){this.addDependency(s.default.normalize(e.filename))}r(new a.default(e));return}finally{n.logger.removeListener(f);delete l.pluginManager.webpackLoaderContext;delete l.pluginManager}const{css:m,imports:b}=d;b.forEach((e=>{if((0,i.isUnsupportedUrl)(e)){return}const t=s.default.normalize(e);if(s.default.isAbsolute(t)){this.addDependency(t)}}));let g=typeof d.map==="string"?JSON.parse(d.map):d.map;if(g&&c){g=(0,i.normalizeSourceMap)(g,this.rootContext)}r(null,m,g)}var l=lessLoader;t["default"]=l},196:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.getLessImplementation=getLessImplementation;t.getLessOptions=getLessOptions;t.isUnsupportedUrl=isUnsupportedUrl;t.normalizeSourceMap=normalizeSourceMap;var n=_interopRequireDefault(r(17));var s=r(195);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}const o=/[/\\]$/;const i=/^~[^/]+$/;const a=/^[a-z]:[/\\]|^\\\\/i;const l=/^~([^/]+|[^/]+\/|@[^/]+[/][^/]+|@[^/]+\/?|@[^/]+[/][^/]+\/)$/;const c=/^[^?]*~/;function createWebpackLessPlugin(e,t){const r=e.getResolve({dependencyType:"less",conditionNames:["less","style","..."],mainFields:["less","style","main","..."],mainFiles:["index","..."],extensions:[".less",".css"],preferRelative:true});class WebpackFileManager extends t.FileManager{supports(e){if(e[0]==="/"||a.test(e)){return true}if(this.isPathAbsolute(e)){return false}return true}supportsSync(){return false}async resolveFilename(e,t){const r=t.replace(o,"");let n=e;if(c.test(e)){n=n.replace(c,"")}if(l.test(e)){n=n[n.length-1]==="/"?n:`${n}/`}return this.resolveRequests(r,[...new Set([n,e])])}async resolveRequests(e,t){if(t.length===0){return Promise.reject()}let n;try{n=await r(e,t[0])}catch(r){const[,...s]=t;if(s.length===0){throw r}n=await this.resolveRequests(e,s)}return n}async loadFile(t,...r){let s;try{if(i.test(t)){const e=new Error;e.type="Next";throw e}s=await super.loadFile(t,...r)}catch(n){if(n.type!=="File"&&n.type!=="Next"){return Promise.reject(n)}try{s=await this.resolveFilename(t,...r)}catch(e){n.message=`Less resolver error:\n${n.message}\n\n`+`Webpack resolver error details:\n${e.details}\n\n`+`Webpack resolver error missing:\n${e.missing}\n\n`;return Promise.reject(n)}e.addDependency(s);return super.loadFile(s,...r)}e.addDependency(n.default.normalize(s.filename));return s}}return{install(e,t){t.addFileManager(new WebpackFileManager)},minVersion:[3,0,0]}}function getLessOptions(e,t,r){const n=(0,s.klona)(typeof t.lessOptions==="function"?t.lessOptions(e)||{}:t.lessOptions||{});const o={plugins:[],relativeUrls:true,filename:e.resourcePath,...n};const i=typeof t.webpackImporter==="boolean"?t.webpackImporter:true;if(i){o.plugins.unshift(createWebpackLessPlugin(e,r))}o.plugins.unshift({install(t,r){r.webpackLoaderContext=e;o.pluginManager=r}});return o}function isUnsupportedUrl(e){if(a.test(e)){return false}return/^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(e)}function normalizeSourceMap(e){const t=e;delete t.file;t.sourceRoot="";t.sources=t.sources.map((e=>n.default.normalize(e)));return t}function getLessImplementation(e,t){let r=t;if(!t||typeof t==="string"){const n=t||"less";try{r=require(n)}catch(t){e.emitError(t);return}}return r}},17:function(e){"use strict";e.exports=require("path")},305:function(e){"use strict";e.exports=JSON.parse('{"title":"Less Loader options","type":"object","properties":{"lessOptions":{"description":"Options to pass through to `Less`.","link":"https://github.com/webpack-contrib/less-loader#lessoptions","anyOf":[{"type":"object","additionalProperties":true},{"instanceof":"Function"}]},"additionalData":{"description":"Prepends/Appends `Less` code to the actual entry file.","link":"https://github.com/webpack-contrib/less-loader#additionalData","anyOf":[{"type":"string"},{"instanceof":"Function"}]},"sourceMap":{"description":"Enables/Disables generation of source maps.","link":"https://github.com/webpack-contrib/less-loader#sourcemap","type":"boolean"},"webpackImporter":{"description":"Enables/Disables default `webpack` importer.","link":"https://github.com/webpack-contrib/less-loader#webpackimporter","type":"boolean"},"implementation":{"description":"The implementation of the `Less` to be used.","link":"https://github.com/webpack-contrib/less-loader#implementation","anyOf":[{"type":"string"},{"type":"object"}]}},"additionalProperties":false}')}};var t={};function __nccwpck_require__(r){var n=t[r];if(n!==undefined){return n.exports}var s=t[r]={exports:{}};var o=true;try{e[r](s,s.exports,__nccwpck_require__);o=false}finally{if(o)delete t[r]}return s.exports}if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var r=__nccwpck_require__(100);module.exports=r})();
@@ -1 +1 @@
1
- {"name":"less-loader","author":"Johannes Ewald @jhnns","license":"MIT"}
1
+ {"name":"less-loader","version":"11.1.0","author":"Johannes Ewald @jhnns","license":"MIT"}
@@ -1,70 +1,77 @@
1
1
  "use strict";
2
2
 
3
3
  /* eslint-env browser */
4
-
5
4
  /*
6
5
  eslint-disable
7
6
  no-console,
8
7
  func-names
9
8
  */
10
- var normalizeUrl = require("./normalize-url");
11
9
 
10
+ /** @typedef {any} TODO */
11
+
12
+ var normalizeUrl = require("./normalize-url");
12
13
  var srcByModuleId = Object.create(null);
13
14
  var noDocument = typeof document === "undefined";
14
15
  var forEach = Array.prototype.forEach;
15
16
 
17
+ /**
18
+ * @param {function} fn
19
+ * @param {number} time
20
+ * @returns {(function(): void)|*}
21
+ */
16
22
  function debounce(fn, time) {
17
23
  var timeout = 0;
18
24
  return function () {
19
- var self = this; // eslint-disable-next-line prefer-rest-params
20
-
25
+ // @ts-ignore
26
+ var self = this;
27
+ // eslint-disable-next-line prefer-rest-params
21
28
  var args = arguments;
22
-
23
29
  var functionCall = function functionCall() {
24
30
  return fn.apply(self, args);
25
31
  };
26
-
27
32
  clearTimeout(timeout);
33
+
34
+ // @ts-ignore
28
35
  timeout = setTimeout(functionCall, time);
29
36
  };
30
37
  }
31
-
32
38
  function noop() {}
33
39
 
40
+ /**
41
+ * @param {TODO} moduleId
42
+ * @returns {TODO}
43
+ */
34
44
  function getCurrentScriptUrl(moduleId) {
35
45
  var src = srcByModuleId[moduleId];
36
-
37
46
  if (!src) {
38
47
  if (document.currentScript) {
39
- src = document.currentScript.src;
48
+ src = /** @type {HTMLScriptElement} */document.currentScript.src;
40
49
  } else {
41
50
  var scripts = document.getElementsByTagName("script");
42
51
  var lastScriptTag = scripts[scripts.length - 1];
43
-
44
52
  if (lastScriptTag) {
45
53
  src = lastScriptTag.src;
46
54
  }
47
55
  }
48
-
49
56
  srcByModuleId[moduleId] = src;
50
57
  }
51
58
 
59
+ /**
60
+ * @param {string} fileMap
61
+ * @returns {null | string[]}
62
+ */
52
63
  return function (fileMap) {
53
64
  if (!src) {
54
65
  return null;
55
66
  }
56
-
57
67
  var splitResult = src.split(/([^\\/]+)\.js$/);
58
68
  var filename = splitResult && splitResult[1];
59
-
60
69
  if (!filename) {
61
70
  return [src.replace(".js", ".css")];
62
71
  }
63
-
64
72
  if (!fileMap) {
65
73
  return [src.replace(".js", ".css")];
66
74
  }
67
-
68
75
  return fileMap.split(",").map(function (mapRule) {
69
76
  var reg = new RegExp("".concat(filename, "\\.js$"), "g");
70
77
  return normalizeUrl(src.replace(reg, "".concat(mapRule.replace(/{fileName}/g, filename), ".css")));
@@ -72,31 +79,32 @@ function getCurrentScriptUrl(moduleId) {
72
79
  };
73
80
  }
74
81
 
82
+ /**
83
+ * @param {TODO} el
84
+ * @param {string} [url]
85
+ */
75
86
  function updateCss(el, url) {
76
87
  if (!url) {
77
88
  if (!el.href) {
78
89
  return;
79
- } // eslint-disable-next-line
80
-
90
+ }
81
91
 
92
+ // eslint-disable-next-line
82
93
  url = el.href.split("?")[0];
83
94
  }
84
-
85
- if (!isUrlRequest(url)) {
95
+ if (!isUrlRequest( /** @type {string} */url)) {
86
96
  return;
87
97
  }
88
-
89
98
  if (el.isLoaded === false) {
90
99
  // We seem to be about to replace a css link that hasn't loaded yet.
91
100
  // We're probably changing the same file more than once.
92
101
  return;
93
102
  }
94
-
95
103
  if (!url || !(url.indexOf(".css") > -1)) {
96
104
  return;
97
- } // eslint-disable-next-line no-param-reassign
98
-
105
+ }
99
106
 
107
+ // eslint-disable-next-line no-param-reassign
100
108
  el.visited = true;
101
109
  var newEl = el.cloneNode();
102
110
  newEl.isLoaded = false;
@@ -104,7 +112,6 @@ function updateCss(el, url) {
104
112
  if (newEl.isLoaded) {
105
113
  return;
106
114
  }
107
-
108
115
  newEl.isLoaded = true;
109
116
  el.parentNode.removeChild(el);
110
117
  });
@@ -112,12 +119,10 @@ function updateCss(el, url) {
112
119
  if (newEl.isLoaded) {
113
120
  return;
114
121
  }
115
-
116
122
  newEl.isLoaded = true;
117
123
  el.parentNode.removeChild(el);
118
124
  });
119
125
  newEl.href = "".concat(url, "?").concat(Date.now());
120
-
121
126
  if (el.nextSibling) {
122
127
  el.parentNode.insertBefore(newEl, el.nextSibling);
123
128
  } else {
@@ -125,14 +130,22 @@ function updateCss(el, url) {
125
130
  }
126
131
  }
127
132
 
133
+ /**
134
+ * @param {string} href
135
+ * @param {TODO} src
136
+ * @returns {TODO}
137
+ */
128
138
  function getReloadUrl(href, src) {
129
- var ret; // eslint-disable-next-line no-param-reassign
130
-
131
- href = normalizeUrl(href, {
132
- stripWWW: false
133
- }); // eslint-disable-next-line array-callback-return
134
-
135
- src.some(function (url) {
139
+ var ret;
140
+
141
+ // eslint-disable-next-line no-param-reassign
142
+ href = normalizeUrl(href);
143
+ src.some(
144
+ /**
145
+ * @param {string} url
146
+ */
147
+ // eslint-disable-next-line array-callback-return
148
+ function (url) {
136
149
  if (href.indexOf(src) > -1) {
137
150
  ret = url;
138
151
  }
@@ -140,28 +153,27 @@ function getReloadUrl(href, src) {
140
153
  return ret;
141
154
  }
142
155
 
156
+ /**
157
+ * @param {string} [src]
158
+ * @returns {boolean}
159
+ */
143
160
  function reloadStyle(src) {
144
161
  if (!src) {
145
162
  return false;
146
163
  }
147
-
148
164
  var elements = document.querySelectorAll("link");
149
165
  var loaded = false;
150
166
  forEach.call(elements, function (el) {
151
167
  if (!el.href) {
152
168
  return;
153
169
  }
154
-
155
170
  var url = getReloadUrl(el.href, src);
156
-
157
171
  if (!isUrlRequest(url)) {
158
172
  return;
159
173
  }
160
-
161
174
  if (el.visited === true) {
162
175
  return;
163
176
  }
164
-
165
177
  if (url) {
166
178
  updateCss(el, url);
167
179
  loaded = true;
@@ -169,46 +181,49 @@ function reloadStyle(src) {
169
181
  });
170
182
  return loaded;
171
183
  }
172
-
173
184
  function reloadAll() {
174
185
  var elements = document.querySelectorAll("link");
175
186
  forEach.call(elements, function (el) {
176
187
  if (el.visited === true) {
177
188
  return;
178
189
  }
179
-
180
190
  updateCss(el);
181
191
  });
182
192
  }
183
193
 
194
+ /**
195
+ * @param {string} url
196
+ * @returns {boolean}
197
+ */
184
198
  function isUrlRequest(url) {
185
199
  // An URL is not an request if
200
+
186
201
  // It is not http or https
187
202
  if (!/^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(url)) {
188
203
  return false;
189
204
  }
190
-
191
205
  return true;
192
206
  }
193
207
 
208
+ /**
209
+ * @param {TODO} moduleId
210
+ * @param {TODO} options
211
+ * @returns {TODO}
212
+ */
194
213
  module.exports = function (moduleId, options) {
195
214
  if (noDocument) {
196
215
  console.log("no window.document found, will not HMR CSS");
197
216
  return noop;
198
217
  }
199
-
200
218
  var getScriptSrc = getCurrentScriptUrl(moduleId);
201
-
202
219
  function update() {
203
220
  var src = getScriptSrc(options.filename);
204
221
  var reloaded = reloadStyle(src);
205
-
206
222
  if (options.locals) {
207
223
  console.log("[HMR] Detected local css modules. Reload all css");
208
224
  reloadAll();
209
225
  return;
210
226
  }
211
-
212
227
  if (reloaded) {
213
228
  console.log("[HMR] css reload %s", src.join(" "));
214
229
  } else {
@@ -216,6 +231,5 @@ module.exports = function (moduleId, options) {
216
231
  reloadAll();
217
232
  }
218
233
  }
219
-
220
234
  return debounce(update, 50);
221
235
  };
@@ -1,31 +1,35 @@
1
1
  "use strict";
2
2
 
3
3
  /* eslint-disable */
4
+
5
+ /**
6
+ * @param {string[]} pathComponents
7
+ * @returns {string}
8
+ */
4
9
  function normalizeUrl(pathComponents) {
5
10
  return pathComponents.reduce(function (accumulator, item) {
6
11
  switch (item) {
7
12
  case "..":
8
13
  accumulator.pop();
9
14
  break;
10
-
11
15
  case ".":
12
16
  break;
13
-
14
17
  default:
15
18
  accumulator.push(item);
16
19
  }
17
-
18
20
  return accumulator;
19
- }, []).join("/");
21
+ }, /** @type {string[]} */[]).join("/");
20
22
  }
21
23
 
24
+ /**
25
+ * @param {string} urlString
26
+ * @returns {string}
27
+ */
22
28
  module.exports = function (urlString) {
23
29
  urlString = urlString.trim();
24
-
25
30
  if (/^data:/i.test(urlString)) {
26
31
  return urlString;
27
32
  }
28
-
29
33
  var protocol = urlString.indexOf("//") !== -1 ? urlString.split("//")[0] + "//" : "";
30
34
  var components = urlString.replace(new RegExp(protocol, "i"), "").split("/");
31
35
  var host = components[0].toLowerCase().replace(/\.$/, "");