@flatjs/evolve 2.1.0-next.3 → 2.1.0-next.30

Sign up to get free protection for your applications and to get access to all the features.
Files changed (167) hide show
  1. package/dist/compiler/create-global-compiler.d.ts +2 -0
  2. package/dist/compiler/create-global-compiler.js +1 -0
  3. package/dist/constants.d.ts +9 -0
  4. package/dist/constants.js +1 -1
  5. package/dist/create-webpack/create-externals.d.ts +1 -1
  6. package/dist/create-webpack/create-externals.js +1 -1
  7. package/dist/create-webpack/create-optimization.d.ts +1 -1
  8. package/dist/create-webpack/create-optimization.js +1 -1
  9. package/dist/create-webpack/create-output.d.ts +1 -1
  10. package/dist/create-webpack/create-performance.d.ts +1 -1
  11. package/dist/create-webpack/create-plugins.d.ts +2 -1
  12. package/dist/create-webpack/create-plugins.js +1 -1
  13. package/dist/create-webpack/create-resolve.js +1 -1
  14. package/dist/create-webpack/create-rule-sets.d.ts +1 -1
  15. package/dist/create-webpack/create-rule-sets.js +1 -1
  16. package/dist/create-webpack/load-watch-options.d.ts +12 -0
  17. package/dist/create-webpack/load-watch-options.js +1 -0
  18. package/dist/create-webpack/load-webpack-config.d.ts +2 -1
  19. package/dist/create-webpack/load-webpack-config.js +1 -1
  20. package/dist/create-webpack/rule-sets/rule-assets.d.ts +2 -2
  21. package/dist/create-webpack/rule-sets/rule-assets.js +1 -1
  22. package/dist/create-webpack/rule-sets/rule-css.js +1 -1
  23. package/dist/create-webpack/rule-sets/rule-scripts.d.ts +2 -0
  24. package/dist/create-webpack/rule-sets/rule-scripts.js +1 -1
  25. package/dist/create-webpack/types.d.ts +1 -1
  26. package/dist/default-options.js +1 -1
  27. package/dist/define-config/define-config.d.ts +2 -2
  28. package/dist/dev-server/add-compiler-to-dev-server.js +1 -1
  29. package/dist/dev-server/create-dev-server-compiler-task.d.ts +3 -0
  30. package/dist/dev-server/create-dev-server-compiler-task.js +1 -0
  31. package/dist/dev-server/create-dev-server-entries.d.ts +1 -1
  32. package/dist/dev-server/create-dev-server-entries.js +1 -1
  33. package/dist/dev-server/create-dev-server.js +1 -1
  34. package/dist/dev-server/index.d.ts +3 -3
  35. package/dist/dev-server/index.js +1 -1
  36. package/dist/dev-server/middlewares/get-bundle-asset.d.ts +1 -1
  37. package/dist/dev-server/middlewares/get-page-main-html.js +1 -1
  38. package/dist/dev-server/middlewares/get-page-module-html.js +1 -1
  39. package/dist/helpers/assert-group-entry-item.d.ts +7 -0
  40. package/dist/helpers/assert-group-entry-item.js +1 -0
  41. package/dist/helpers/assert-single-compiler.d.ts +15 -0
  42. package/dist/helpers/assert-single-compiler.js +1 -0
  43. package/dist/helpers/check-runtime-env.d.ts +4 -0
  44. package/dist/helpers/check-runtime-env.js +1 -0
  45. package/dist/helpers/custom-listr-renderer.d.ts +41 -0
  46. package/dist/helpers/custom-listr-renderer.js +1 -0
  47. package/dist/helpers/custom-message-channel.d.ts +17 -0
  48. package/dist/helpers/custom-message-channel.js +1 -0
  49. package/dist/helpers/delete-object-keys.d.ts +11 -0
  50. package/dist/helpers/delete-object-keys.js +1 -0
  51. package/dist/helpers/flat-entry-map.d.ts +8 -0
  52. package/dist/helpers/flat-entry-map.js +1 -0
  53. package/dist/helpers/format-spinner-text.d.ts +8 -0
  54. package/dist/helpers/format-spinner-text.js +1 -0
  55. package/dist/helpers/get-bundle-file-name.d.ts +1 -1
  56. package/dist/helpers/get-runtime-cdn-base.d.ts +2 -0
  57. package/dist/helpers/get-runtime-cdn-base.js +1 -0
  58. package/dist/helpers/get-stats-file-name.d.ts +2 -0
  59. package/dist/helpers/get-stats-file-name.js +1 -0
  60. package/dist/helpers/index.d.ts +18 -4
  61. package/dist/helpers/index.js +1 -1
  62. package/dist/helpers/is-deep-equal.d.ts +9 -0
  63. package/dist/helpers/is-deep-equal.js +1 -0
  64. package/dist/helpers/json-serializer.js +1 -1
  65. package/dist/helpers/normalize-check-entry-options.d.ts +10 -0
  66. package/dist/helpers/normalize-check-entry-options.js +1 -0
  67. package/dist/helpers/normalize-entry-map.d.ts +1 -0
  68. package/dist/helpers/normalize-entry-map.js +1 -1
  69. package/dist/helpers/normalize-entry-module-absolute-path.d.ts +10 -0
  70. package/dist/helpers/normalize-entry-module-absolute-path.js +1 -0
  71. package/dist/helpers/normalize-group-name.d.ts +8 -0
  72. package/dist/helpers/normalize-group-name.js +1 -0
  73. package/dist/helpers/normalize-template-inject-tokens.d.ts +16 -0
  74. package/dist/helpers/normalize-template-inject-tokens.js +1 -0
  75. package/dist/helpers/open-page.js +1 -1
  76. package/dist/helpers/refresh-evolve-mock-options.js +1 -1
  77. package/dist/helpers/script-injects.d.ts +1 -1
  78. package/dist/helpers/should-enable-react-fast-refresh.js +1 -1
  79. package/dist/helpers/split-to-entry-group.d.ts +52 -0
  80. package/dist/helpers/split-to-entry-group.js +1 -0
  81. package/dist/helpers/verify-group-entry-options.d.ts +9 -0
  82. package/dist/helpers/verify-group-entry-options.js +1 -0
  83. package/dist/index.d.ts +1 -1
  84. package/dist/index.js +1 -1
  85. package/dist/load-config/load-evolve-config.js +1 -1
  86. package/dist/loaders/loader-icon.cjs +2 -1
  87. package/dist/main/create-thread-worker.d.ts +29 -14
  88. package/dist/main/create-thread-worker.js +1 -1
  89. package/dist/main/index.d.ts +1 -1
  90. package/dist/main/index.js +1 -1
  91. package/dist/main/prepare-analyzer.d.ts +9 -0
  92. package/dist/main/prepare-analyzer.js +1 -0
  93. package/dist/main/prepare-build.d.ts +4 -3
  94. package/dist/main/prepare-build.js +1 -1
  95. package/dist/main/prepare-serve.d.ts +1 -1
  96. package/dist/main/prepare-serve.js +1 -1
  97. package/dist/main/start-analyzer.d.ts +10 -0
  98. package/dist/main/start-analyzer.js +1 -0
  99. package/dist/main/start-build-dynamic.d.ts +2 -2
  100. package/dist/main/start-build-dynamic.js +1 -1
  101. package/dist/main/start-build-worker.d.ts +17 -6
  102. package/dist/main/start-build-worker.js +1 -1
  103. package/dist/main/start-build.d.ts +3 -2
  104. package/dist/main/start-build.js +1 -1
  105. package/dist/main/start-group-entry-build.d.ts +15 -0
  106. package/dist/main/start-group-entry-build.js +1 -0
  107. package/dist/main/start-serve.d.ts +1 -1
  108. package/dist/main/start-serve.js +1 -1
  109. package/dist/minimizer/create-minimizers.js +1 -1
  110. package/dist/minimizer/image-minimizer.js +1 -1
  111. package/dist/minimizer/terser-minimizer.js +1 -1
  112. package/dist/plugins/circular-dependency/circular-dependency-plugin.js +1 -1
  113. package/dist/plugins/clean-webpack/index.d.ts +1 -1
  114. package/dist/plugins/clean-webpack/index.js +1 -1
  115. package/dist/plugins/define-variable/define-variable-plugin.js +1 -1
  116. package/dist/plugins/module-federation/module-federation.d.ts +1 -1
  117. package/dist/plugins/module-federation/module-federation.js +1 -1
  118. package/dist/plugins/multi-html/index.d.ts +1 -1
  119. package/dist/plugins/multi-html/index.js +1 -1
  120. package/dist/plugins/multi-html/multi-html-cdn-plugin.js +1 -1
  121. package/dist/plugins/multi-html/multi-html-plugin.d.ts +1 -1
  122. package/dist/plugins/multi-html/multi-html-plugin.js +1 -1
  123. package/dist/plugins/stats-webpack/helper-write-stats.d.ts +28 -0
  124. package/dist/plugins/stats-webpack/helper-write-stats.js +1 -0
  125. package/dist/plugins/stats-webpack/index.d.ts +12 -0
  126. package/dist/plugins/stats-webpack/index.js +1 -0
  127. package/dist/plugins/stats-webpack/stats-webpack-plugin.d.ts +25 -0
  128. package/dist/plugins/stats-webpack/stats-webpack-plugin.js +1 -0
  129. package/dist/plugins/ts-checker/ts-checker-guard-plugin.d.ts +13 -0
  130. package/dist/plugins/ts-checker/ts-checker-guard-plugin.js +1 -0
  131. package/dist/plugins/ts-checker/ts-checker-plugin.d.ts +3 -0
  132. package/dist/plugins/ts-checker/ts-checker-plugin.js +1 -0
  133. package/dist/types/index.d.ts +3 -1
  134. package/dist/types/index.js +1 -1
  135. package/dist/types/types-analyzer.d.ts +70 -0
  136. package/dist/types/types-analyzer.js +1 -0
  137. package/dist/types/types-cli-options.d.ts +12 -0
  138. package/dist/types/types-cli-options.js +1 -0
  139. package/dist/types/types-dev-server.d.ts +17 -6
  140. package/dist/types/types-entry-map.d.ts +21 -3
  141. package/dist/types/types-global-compiler-options.d.ts +7 -0
  142. package/dist/types/types-global-compiler-options.js +1 -0
  143. package/dist/types/types-loader-options.d.ts +31 -9
  144. package/dist/types/types-options.d.ts +30 -15
  145. package/dist/types/types-threads-options.d.ts +18 -0
  146. package/dist/types/types-threads-options.js +1 -0
  147. package/dist/types/types-webpack.d.ts +5 -2
  148. package/package.json +69 -61
  149. package/templates/html-plugin/index-dev.html +2 -2
  150. package/templates/html-plugin/index-inte.html +2 -2
  151. package/templates/html-plugin/index-inte2.html +2 -2
  152. package/templates/html-plugin/index-inte3.html +2 -2
  153. package/templates/html-plugin/index-inte4.html +2 -2
  154. package/templates/html-plugin/index-me.html +2 -2
  155. package/templates/html-plugin/index-ntv.html +61 -0
  156. package/templates/html-plugin/index-prod.html +2 -2
  157. package/templates/html-plugin/index-rc.html +2 -2
  158. package/templates/html-plugin/index-uat.html +2 -2
  159. package/templates/module.html +2 -2
  160. package/dist/dev-server/create-dev-server-compiler-tasks.d.ts +0 -3
  161. package/dist/dev-server/create-dev-server-compiler-tasks.js +0 -1
  162. package/dist/helpers/assert-only-single-entry-item.d.ts +0 -7
  163. package/dist/helpers/assert-only-single-entry-item.js +0 -1
  164. package/dist/helpers/split-to-multi-compiler.d.ts +0 -8
  165. package/dist/helpers/split-to-multi-compiler.js +0 -1
  166. package/dist/main/start-one-entry-build.d.ts +0 -13
  167. package/dist/main/start-one-entry-build.js +0 -1
@@ -1 +1 @@
1
- import{join}from"node:path";import{ensureSlash}from"@flatjs/common";import webpack from"webpack";import{normalizeEvolveEntryName}from"../../helpers/normalize-entry-map.js";import{injectFederationScripts}from"../../helpers/script-injects.js";import{HtmlInjectScriptPlugin}from"../html-inject-scripts/plugin-html-inject-script.js";import{ExternalTemplateRemotesPlugin}from"./external-template-remotes.js";const normalizeWidgetName=(e="")=>e.replace(/[/-]/g,"_").toLowerCase(),remoteFileName=e=>join(e,"micro-remote-module.js");export const createModuleFederationPlugin=(e,t,r)=>{const o=r.projectVirtualPath,[n,i]=t,m=r.multiHtmlCdn,a=r.multiHtmlCdnEnvResolver,l=i.options?.moduleFederation,s=[];if(l){const{remotes:t,exposes:r,...i}=l,p=remoteFileName(n),c=normalizeWidgetName(n),u=(r?Array.isArray(r)?r:[r]:[]).map((e=>{const t={};for(const[r,o]of Object.entries(e))t[r]={...o,name:join(n,o.name.replace(/^\//,""))};return t})),d=(t||[]).map((({name:e,endpoint:t})=>{const r=normalizeEvolveEntryName(e,o),n=normalizeWidgetName(r),i=remoteFileName(r);return{[n]:`${n}@${t?ensureSlash(t(e,r),!1):"[window.evolveFetchMicroWidgets()]"}/${i}`}}));s.push(new webpack.container.ModuleFederationPlugin({...i,name:c,filename:p,remotes:d,exposes:u}),new ExternalTemplateRemotesPlugin),e||s.unshift(new HtmlInjectScriptPlugin([injectFederationScripts(m,a)]))}return s};
1
+ import{join}from"node:path";import webpack from"webpack";import{ensureSlash}from"@flatjs/common";import{normalizeEvolveEntryName}from"../../helpers/normalize-entry-map.js";import{injectFederationScripts}from"../../helpers/script-injects.js";import{HtmlInjectScriptPlugin}from"../html-inject-scripts/plugin-html-inject-script.js";import{ExternalTemplateRemotesPlugin}from"./external-template-remotes.js";const normalizeWidgetName=(e="")=>e.replace(/[/-]/g,"_").toLowerCase(),remoteFileName=e=>join(e,"micro-remote-module.js");export const createModuleFederationPlugin=(e,t,o)=>{const r=o.projectVirtualPath,n=o.multiHtmlCdn,i=o.multiHtmlCdnEnvResolver,m=[];for(const o of t){const[t,a]=o,l=a.options?.moduleFederation;if(l){const{remotes:o,exposes:a,...s}=l,c=remoteFileName(t),p=normalizeWidgetName(t),u=(a?Array.isArray(a)?a:[a]:[]).map((e=>{const o={};for(const[r,n]of Object.entries(e))o[r]={...n,name:join(t,n.name.replace(/^\//,""))};return o})),d=(o||[]).map((({name:e,endpoint:t})=>{const o=normalizeEvolveEntryName(e,r),n=normalizeWidgetName(o),i=remoteFileName(o),m=t?ensureSlash(t(e,o),!1):"[window.evolveFetchMicroWidgets()]";return{[n]:`${n}@${m}/${i}`}}));m.push(new webpack.container.ModuleFederationPlugin({...s,name:p,filename:c,remotes:d,exposes:u}),new ExternalTemplateRemotesPlugin),e||m.unshift(new HtmlInjectScriptPlugin([injectFederationScripts(n,i)]))}}return m};
@@ -1,4 +1,4 @@
1
1
  import { type WebpackPlugin } from '../../create-webpack/types.js';
2
2
  import { type EntryMapItem } from '../../types/types-entry-map.js';
3
3
  import { type FlatEvolveOptions } from '../../types/types-options.js';
4
- export declare const createHtmlPlugins: (serveMode: boolean, entryMapItem: EntryMapItem, evolveOptions: FlatEvolveOptions) => WebpackPlugin[];
4
+ export declare const createHtmlPlugins: (serveMode: boolean, entryMapItemList: EntryMapItem[], evolveOptions: FlatEvolveOptions) => WebpackPlugin[];
@@ -1 +1 @@
1
- import{FlatEvolveMultiCdnPlugin}from"./multi-html-cdn-plugin.js";import{createMultiHtmlWebpackPlugin}from"./multi-html-plugin.js";export const createHtmlPlugins=(t,l,u)=>{const i=[];if(t||l[1]?.options?.output?.library)return i;const n=Object.keys(u.multiHtmlCdn);return i.push(...createMultiHtmlWebpackPlugin(t,u,l,n)),i.push(new FlatEvolveMultiCdnPlugin(u)),i};
1
+ import{FlatEvolveMultiCdnPlugin}from"./multi-html-cdn-plugin.js";import{createMultiHtmlWebpackPlugin}from"./multi-html-plugin.js";export const createHtmlPlugins=(t,l,u)=>{const i=[],n=l[0];if(t||n[1]?.options?.output?.library)return i;const e=Object.keys(u.multiHtmlCdn);return i.push(...createMultiHtmlWebpackPlugin(t,u,l,e)),i.push(new FlatEvolveMultiCdnPlugin(u)),i};
@@ -1 +1 @@
1
- import{basename}from"node:path";import HtmlWebpackPlugin from"html-webpack-plugin";import webpack from"webpack";import{cdnFinder,findEnvCdn,httpUrlJoin}from"../../helpers/script-injects.js";export class FlatEvolveMultiCdnPlugin{constructor(e){if(this.pluginName="FlatEvolveMultiCdnPlugin",this.requireFn=webpack.RuntimeGlobals.publicPath,this.config=e.multiHtmlCdn,this.cdnResolver=e.multiHtmlCdnEnvResolver||function cdnResolver(){},!this.config?.prod)throw new Error("We must setup `prod` for each CDN config node!")}apply(e){e.hooks.thisCompilation.tap(this.pluginName,(e=>{e.mainTemplate.hooks.requireExtensions.tap(this.pluginName,((n,t)=>{const i=[];i.push("// Dynamic assets path override(`@flatjs/evolve`) plugin-multi-html-cdn`)");const s=e.chunkGraph?.getTreeRuntimeRequirements(t);return s&&s.has(webpack.RuntimeGlobals.requireScope)&&(i.push("(function () {"),i.push(webpack.Template.indent("var flatjsMultiCdn = {")),i.push(webpack.Template.indent(webpack.Template.indent([`cdnConfig: ${JSON.stringify(this.config||{})},`]))),i.push(webpack.Template.indent(webpack.Template.indent([`cdnResolver: ${this.cdnResolver.toString()},`]))),i.push(webpack.Template.indent(webpack.Template.indent([`cdnFinder: ${cdnFinder.toString()}`]))),i.push(webpack.Template.indent("};")),i.push(webpack.Template.indent(`${this.requireFn} = flatjsMultiCdn.cdnFinder(flatjsMultiCdn.cdnConfig, flatjsMultiCdn.cdnResolver) || ${this.requireFn};`)),i.push("})();")),webpack.Template.asString(i)}))})),e.hooks.compilation.tap(this.pluginName,(e=>{HtmlWebpackPlugin.getHooks(e).beforeAssetTagGeneration.tap(this.pluginName,(e=>{const{assets:n}=e,{userOptions:t}=e.plugin,i=t.multiCdn,s=n.publicPath,a=n.js.map((e=>{if(i.disabled)return basename(e);const n=findEnvCdn(this.config,i.env);return httpUrlJoin(n,e.replace(s,""))})),p=n.css.map((e=>{if(i.disabled)return basename(e);const n=findEnvCdn(this.config,i.env);return httpUrlJoin(n,e.replace(s,""))}));return e.assets.js=a,e.assets.css=p,e}))}))}}
1
+ import HtmlWebpackPlugin from"html-webpack-plugin";import{basename}from"node:path";import webpack from"webpack";import{getRuntimeCDNBase}from"../../helpers/get-runtime-cdn-base.js";import{findEnvCdn,httpUrlJoin}from"../../helpers/script-injects.js";export class FlatEvolveMultiCdnPlugin{constructor(e){if(this.pluginName="FlatEvolveMultiCdnPlugin",this.requireFn=webpack.RuntimeGlobals.publicPath,this.config=e.multiHtmlCdn,this.cdnResolver=e.multiHtmlCdnEnvResolver||function cdnResolver(){},!this.config?.prod)throw new Error("We must setup `prod` for each CDN config node!")}apply(e){e.hooks.thisCompilation.tap(this.pluginName,(e=>{e.mainTemplate.hooks.requireExtensions.tap(this.pluginName,((t,n)=>{const i=[];i.push("// Dynamic assets path override(`@flatjs/evolve`) plugin-multi-html-cdn`)");const s=e.chunkGraph?.getTreeRuntimeRequirements(n);return s&&s.has(webpack.RuntimeGlobals.requireScope)&&i.push(webpack.Template.indent(getRuntimeCDNBase(this.config,this.cdnResolver,this.requireFn))),webpack.Template.asString(i)}))})),e.hooks.compilation.tap(this.pluginName,(e=>{HtmlWebpackPlugin.getHooks(e).beforeAssetTagGeneration.tap(this.pluginName,(e=>{const{assets:t,plugin:n,outputName:i}=e,s=n?.options?.chunks||[],r=Array.isArray(s)?s.find((e=>i.includes(e))):s,{userOptions:o}=e.plugin;if(!r)throw new Error("We must have current chunk!");const a=t.js.filter((e=>e.includes(r))),l=t.css.filter((e=>e.includes(r))),p=o.multiCdn,u=t.publicPath,c=a.map((e=>{if(p.disabled)return basename(e);const t=findEnvCdn(this.config,p.env);return httpUrlJoin(t,e.replace(u,""))})),m=l.map((e=>{if(p.disabled)return basename(e);const t=findEnvCdn(this.config,p.env);return httpUrlJoin(t,e.replace(u,""))}));return e.assets.js=c,e.assets.css=m,e}))}))}}
@@ -8,4 +8,4 @@ import { type FlatEvolveOptions } from '../../types/types-options.js';
8
8
  * @param buildEntryItem the entries for this `build`
9
9
  * @param allEnv
10
10
  */
11
- export declare const createMultiHtmlWebpackPlugin: (serveMode: boolean, evolveOptions: FlatEvolveOptions, entryMapItem: EntryMapItem, allEnv: Array<EvolveMultiCdnEnvType>) => WebpackPlugin[];
11
+ export declare const createMultiHtmlWebpackPlugin: (serveMode: boolean, evolveOptions: FlatEvolveOptions, entryMapItemList: EntryMapItem[], allEnv: Array<EvolveMultiCdnEnvType>) => WebpackPlugin[];
@@ -1 +1 @@
1
- import HtmlWebpackPlugin from"html-webpack-plugin";import{allowPx2remForModule}from"../../helpers/allow-px2rem-for-module.js";import{getHtmlPluginConfig}from"../../helpers/get-html-plugin-config.js";import{findEnvCdn}from"../../helpers/script-injects.js";const minifyOpts={minifyJS:!0,removeComments:!0,collapseWhitespace:!0,collapseBooleanAttributes:!1};export const createMultiHtmlWebpackPlugin=(e,t,i,l)=>{const[n,o]=i,r=[],{options:m}=o,g=e?"development":"production";for(const e of l){const l={mode:g,envCdn:findEnvCdn(t.multiHtmlCdn,e)};r.push(new HtmlWebpackPlugin({inject:"body",title:getHtmlPluginConfig("title",l,m?.title),chunks:[n],minify:!1!==m?.htmlMinify&&!["me","dev"].includes(e)&&minifyOpts,filename:`${n}/index${"prod"===e?"":`-${e}`}.html`,template:getHtmlPluginConfig("templatePath",l,m?.templatePath).replace("{0}",e),templateParameters:{title:getHtmlPluginConfig("title",l,m?.title),favicon:getHtmlPluginConfig("favicon",l,m?.favicon),headBeforeHtmlTags:getHtmlPluginConfig("headBeforeHtmlTags",l,m?.headBeforeHtmlTags),inlineScripts:getHtmlPluginConfig("inlineScripts",l,m?.inlineScripts),headBeforeStyles:getHtmlPluginConfig("headBeforeStyles",l,m?.headBeforeStyles),headBeforeScripts:getHtmlPluginConfig("headBeforeScripts",l,m?.headBeforeScripts),bodyAfterScripts:getHtmlPluginConfig("bodyAfterScripts",l,m?.bodyAfterScripts),viewport:allowPx2remForModule(i,t)?getHtmlPluginConfig("viewport",l,m?.viewport):""},multiCdn:{env:e,disabled:(m?.excludeCdnEnvs||["me","dev","ntv"]).includes(e)}}))}return r};
1
+ import HtmlWebpackPlugin from"html-webpack-plugin";import{existsSync}from"node:fs";import{logger}from"@flatjs/common";import{allowPx2remForModule}from"../../helpers/allow-px2rem-for-module.js";import{getHtmlPluginConfig}from"../../helpers/get-html-plugin-config.js";import{normalizeTemplateInjectTokens}from"../../helpers/normalize-template-inject-tokens.js";import{findEnvCdn}from"../../helpers/script-injects.js";const minifyOpts={minifyJS:!0,removeComments:!0,collapseWhitespace:!0,collapseBooleanAttributes:!1};export const createMultiHtmlWebpackPlugin=(e,t,l,i)=>{const n=l[0],[,o]=n,m=[],{options:r}=o,p=e?"development":"production",s=l.map((e=>e[0]));for(const e of i){const l={mode:p,envCdn:findEnvCdn(t.multiHtmlCdn,e)},i=normalizeTemplateInjectTokens(l,r);let o=getHtmlPluginConfig("templatePath",l,r?.templatePath).replace("{0}",e.trim());existsSync(o)||(logger.warn(`The template file ${o} is not exists, use \`prod\` instead!`),o=getHtmlPluginConfig("templatePath",l,r?.templatePath).replace("{0}","prod")),m.push(new HtmlWebpackPlugin({inject:"body",title:getHtmlPluginConfig("title",l,r?.title),chunks:s,minify:!1!==r?.htmlMinify&&!["me","dev"].includes(e)&&minifyOpts,filename:t=>`${t}/index${"prod"===e?"":`-${e}`}.html`,template:o,templateParameters:{title:getHtmlPluginConfig("title",l,r?.title),favicon:getHtmlPluginConfig("favicon",l,r?.favicon),viewport:allowPx2remForModule(n,t)?getHtmlPluginConfig("viewport",l,r?.viewport):"",...i},multiCdn:{env:e,disabled:(r?.excludeCdnEnvs||["me","dev","ntv"]).includes(e)}}))}return m};
@@ -0,0 +1,28 @@
1
+ import { Readable } from 'node:stream';
2
+ import { StatsCompilation } from 'webpack';
3
+ /**
4
+ * A readable stream that serializes a StatsCompilation object into a string representation.
5
+ */
6
+ export declare class StatsSerializeStream extends Readable {
7
+ private indentLevel;
8
+ private stringifier;
9
+ /**
10
+ * Creates an instance of StatsSerializeStream.
11
+ * @param stats - The StatsCompilation object to be serialized.
12
+ */
13
+ constructor(stats: StatsCompilation);
14
+ /**
15
+ * Gets the indentation string based on the current indent level.
16
+ */
17
+ get indent(): string;
18
+ /**
19
+ * Implements the _read method required by the Readable stream.
20
+ */
21
+ _read(): void;
22
+ /**
23
+ * Generator function that recursively converts an object into a string representation.
24
+ * @param obj - The object to be serialized.
25
+ */
26
+ _stringify(obj: StatsCompilation): any;
27
+ }
28
+ export declare const writeStats: (stats: StatsCompilation, filepath: string) => Promise<unknown>;
@@ -0,0 +1 @@
1
+ import{createWriteStream}from"node:fs";import{Readable}from"node:stream";export class StatsSerializeStream extends Readable{constructor(e){super(),this.indentLevel=0,this.stringifier=this._stringify(e)}get indent(){return" ".repeat(this.indentLevel)}_read(){let e=!0;for(;e;){const{value:t,done:i}=this.stringifier.next();i?(this.push(null),e=!1):e=this.push(t)}}*_stringify(e){if("string"==typeof e||"number"==typeof e||"boolean"==typeof e||null===e)yield JSON.stringify(e);else if(Array.isArray(e)){yield"[",this.indentLevel++;let t=!0;for(let i of e)void 0===i&&(i=null),yield`${t?"":","}\n${this.indent}`,yield*this._stringify(i),t=!1;this.indentLevel--,yield e.length?`\n${this.indent}]`:"]"}else{yield"{",this.indentLevel++;let t=!0;const i=Object.entries(e);for(const[e,n]of i)void 0!==n&&(yield`${t?"":","}\n${this.indent}${JSON.stringify(e)}: `,yield*this._stringify(n),t=!1);this.indentLevel--,yield i.length?`\n${this.indent}}`:"}"}}}export const writeStats=(e,t)=>new Promise(((i,n)=>{new StatsSerializeStream(e).on("end",i).on("error",n).pipe(createWriteStream(t))}));
@@ -0,0 +1,12 @@
1
+ import { type WebpackPlugin } from '../../create-webpack/types.js';
2
+ import { FlatCliOptions } from '../../types/types-cli-options.js';
3
+ import { type FlatEvolveOptions } from '../../types/types-options.js';
4
+ /**
5
+ * Creates an array of Webpack plugins for generating stats files.
6
+ *
7
+ * @param serveMode - A boolean indicating whether the application is running in serve mode.
8
+ * @param evolveOptions - The options for the evolve package.
9
+ * @param cliOptions - The options passed through the command-line interface.
10
+ * @returns An array of Webpack plugins.
11
+ */
12
+ export declare const createStatsWebpackPlugin: (serveMode: boolean, evolveOptions: FlatEvolveOptions, cliOptions?: FlatCliOptions) => WebpackPlugin[];
@@ -0,0 +1 @@
1
+ import{StatsWebpackPlugin}from"./stats-webpack-plugin.js";export const createStatsWebpackPlugin=(t,e,a={})=>{const{analyzer:r=!1}=a;return t||!r?[]:[new StatsWebpackPlugin({verbose:!0,projectCwd:e.projectCwd})]};
@@ -0,0 +1,25 @@
1
+ import { Compiler, Stats, StatsCompilation } from 'webpack';
2
+ export interface Options {
3
+ /**
4
+ * The project root.
5
+ */
6
+ projectCwd?: string;
7
+ /**
8
+ * Write Logs to Console
9
+ * (Always enabled when dry is true)
10
+ *
11
+ * default: false
12
+ */
13
+ verbose?: boolean;
14
+ }
15
+ export declare class StatsWebpackPlugin {
16
+ private readonly verbose;
17
+ private outputPath;
18
+ private projectCwd;
19
+ private statsFilename;
20
+ constructor(options?: Options);
21
+ apply(compiler: Compiler): void;
22
+ handleBeforeClean(): void;
23
+ handleDone(stats: Stats, callback: (error?: Error) => void): Promise<void>;
24
+ generateStatsFile(stats: StatsCompilation): Promise<void>;
25
+ }
@@ -0,0 +1 @@
1
+ import{rmSync}from"node:fs";import{mkdir}from"node:fs/promises";import{dirname,join,resolve}from"node:path";import{logger}from"@flatjs/common";import{webpackStatsDir}from"../../constants.js";import{getStatsFileName}from"../../helpers/get-stats-file-name.js";import{writeStats}from"./helper-write-stats.js";export class StatsWebpackPlugin{constructor(t={}){this.verbose=!0===t.verbose||!1,this.projectCwd=t.projectCwd||process.cwd(),this.outputPath=join(this.projectCwd,webpackStatsDir)}apply(t){this.handleBeforeClean();t.hooks.done.tapAsync("stats-webpack-plugin",((t,e)=>{this.statsFilename=getStatsFileName(t),this.handleDone(t,e)}))}handleBeforeClean(){rmSync(this.outputPath,{force:!0,recursive:!0})}async handleDone(t,e){try{await this.generateStatsFile(t.toJson()),e()}catch(t){e(t)}}async generateStatsFile(t){const e=resolve(this.outputPath,this.statsFilename);await mkdir(dirname(e),{recursive:!0});try{await writeStats(t,e),this.verbose&&logger.debug(`stats-webpack-plugin: saved stats file to ${e}`)}catch(t){this.verbose&&logger.error(`stats-webpack-plugin: error saving stats file to ${e}: ${t}`)}}}
@@ -0,0 +1,13 @@
1
+ import { type Compiler } from 'webpack';
2
+ export interface TsCheckerGuardPluginOption {
3
+ /**
4
+ * Whether to exit the process when issues is not empty
5
+ * @default false
6
+ */
7
+ autoExit?: boolean;
8
+ }
9
+ export declare class TsCheckerGuardPlugin {
10
+ private options;
11
+ constructor(option?: TsCheckerGuardPluginOption);
12
+ apply(compiler: Compiler): void;
13
+ }
@@ -0,0 +1 @@
1
+ import ForkTsCheckerWebpackPlugin from"fork-ts-checker-webpack-plugin";import{mergeOptions}from"@flatjs/common";export class TsCheckerGuardPlugin{constructor(r={}){this.options=mergeOptions({autoExit:!1},r)}apply(r){ForkTsCheckerWebpackPlugin.getCompilerHooks(r).issues.tap("issues",(r=>{const{autoExit:e}=this.options,o=r.filter((r=>"error"===r.severity));if(e&&o?.length>0)throw new Error(`TS_CHECKER_ERROR: \n ${JSON.stringify(o,null,2)}`);return r}))}}
@@ -0,0 +1,3 @@
1
+ import { type WebpackPlugin } from '../../create-webpack/types.js';
2
+ import { type FlatEvolveOptions } from '../../types/types-options.js';
3
+ export declare const createTsCheckerPlugins: (serveMode: boolean, evolveOptions: FlatEvolveOptions) => WebpackPlugin[];
@@ -0,0 +1 @@
1
+ import ForkTsCheckerWebpackPlugin from"fork-ts-checker-webpack-plugin";import{TsCheckerGuardPlugin}from"./ts-checker-guard-plugin.js";export const createTsCheckerPlugins=(e,r)=>{const{entryMap:t,globalCompilerOptions:c}=r,s=[];let n=!1;for(const[,e]of Object.entries(t)){if((e.entry||[]).find((e=>/.vue$/.test(e)))){n=!0;break}}if(c?.runTsChecker&&!n){const t=new ForkTsCheckerWebpackPlugin({async:e,devServer:!1,issue:{},typescript:{context:r.projectCwd,memoryLimit:8192}});s.push(t),s.push(new TsCheckerGuardPlugin({autoExit:!e}))}return s};
@@ -1,8 +1,10 @@
1
+ export * from './types-analyzer.js';
1
2
  export * from './types-dev-server.js';
2
3
  export * from './types-entry-map.js';
3
4
  export * from './types-federation.js';
5
+ export * from './types-global-compiler-options.js';
6
+ export * from './types-loader-options.js';
4
7
  export * from './types-modular-import.js';
5
8
  export * from './types-multi-html.js';
6
9
  export * from './types-options.js';
7
- export * from './types-loader-options.js';
8
10
  export * from './types-webpack.js';
@@ -1 +1 @@
1
- export*from"./types-dev-server.js";export*from"./types-entry-map.js";export*from"./types-federation.js";export*from"./types-modular-import.js";export*from"./types-multi-html.js";export*from"./types-options.js";export*from"./types-loader-options.js";export*from"./types-webpack.js";
1
+ export*from"./types-analyzer.js";export*from"./types-dev-server.js";export*from"./types-entry-map.js";export*from"./types-federation.js";export*from"./types-global-compiler-options.js";export*from"./types-loader-options.js";export*from"./types-modular-import.js";export*from"./types-multi-html.js";export*from"./types-options.js";export*from"./types-webpack.js";
@@ -0,0 +1,70 @@
1
+ import { type StatsCompilation } from 'webpack';
2
+ type ExcludeAssetsPatternFn = (assetName: string) => boolean;
3
+ type ExcludeAssetsPattern = string | RegExp | ExcludeAssetsPatternFn;
4
+ interface AddressInfo {
5
+ address: string;
6
+ family: string;
7
+ port: number;
8
+ }
9
+ /**
10
+ * Options for serving and analyzing a project.
11
+ */
12
+ export type AnalyzeServeOptions = {
13
+ /**
14
+ * The port number to listen on.
15
+ * @default 0 (auto-assign a port)
16
+ */
17
+ port?: number;
18
+ /**
19
+ * The host address to bind to.
20
+ * @default '127.0.0.1'
21
+ */
22
+ host?: string;
23
+ /**
24
+ * Whether to automatically open the browser.
25
+ * @default true
26
+ */
27
+ openBrowser?: boolean;
28
+ /**
29
+ * The directory where the bundled files are located.
30
+ */
31
+ bundleDir?: string;
32
+ /**
33
+ * Module sizes to show in the report by default.
34
+ * Should be one of "parsed", "stat", or "gzip".
35
+ * @default 'parsed'
36
+ */
37
+ defaultSizes?: 'parsed' | 'stat' | 'gzip' | undefined;
38
+ /**
39
+ * Patterns that will be used to match against asset names to exclude them from the report.
40
+ * If the pattern is a string, it will be converted to a regular expression via `new RegExp(str)`.
41
+ * If the pattern is a function, it should have the following signature: `(assetName: string) => boolean`
42
+ * and should return true to exclude the matching asset.
43
+ * If multiple patterns are provided, an asset should match at least one of them to be excluded.
44
+ * @default null
45
+ */
46
+ excludeAssets?: null | ExcludeAssetsPattern | ExcludeAssetsPattern[] | undefined;
47
+ /**
48
+ * Content of the HTML title element; or a function of the form `() => string` that provides the content.
49
+ * @default A function that returns the pretty printed current date and time.
50
+ */
51
+ reportTitle?: string | (() => string) | undefined;
52
+ /**
53
+ * The URL printed to the console with server mode.
54
+ * @default 'http://${listenHost}:${boundAddress.port}'
55
+ */
56
+ analyzerUrl?: (options: {
57
+ listenPort: string;
58
+ listenHost: string;
59
+ boundAddress: AddressInfo;
60
+ }) => string;
61
+ };
62
+ export type BundleStatsMapping = {
63
+ [statsFilename: string]: StatsCompilation;
64
+ };
65
+ export type PromptsOptionValue = {
66
+ value: string;
67
+ label: string;
68
+ hint?: string;
69
+ };
70
+ export {};
@@ -0,0 +1 @@
1
+ export{};
@@ -0,0 +1,12 @@
1
+ export interface FlatCliOptions {
2
+ /**
3
+ * Visualize size of webpack output files with an interactive zoomable treemap.
4
+ *
5
+ * With build mode `production` only
6
+ *
7
+ * This Configuration take effect only during the build phase
8
+ *
9
+ * @default false
10
+ */
11
+ analyzer?: boolean;
12
+ }
@@ -0,0 +1 @@
1
+ export{};
@@ -1,7 +1,6 @@
1
- import { type SecureContextHttps, type FlatMockOptions } from '@flatjs/mock';
2
1
  import { type RequestHandler } from 'express';
3
- import { type Configuration } from 'webpack';
4
- import { type WebSocketURL, type ClientConfiguration } from 'webpack-dev-server';
2
+ import { type ClientConfiguration, Middleware, type WebSocketURL } from 'webpack-dev-server';
3
+ import { type FlatMockOptions, type SecureContextHttps } from '@flatjs/mock';
5
4
  import { type EvolveEntryMapContent } from './types-entry-map.js';
6
5
  export interface WebpackWatchOptions {
7
6
  /**
@@ -13,9 +12,9 @@ export interface WebpackWatchOptions {
13
12
  */
14
13
  followSymlinks?: boolean;
15
14
  /**
16
- * Ignore some files from watching (glob pattern or regexp).
15
+ * Ignore some files from watching
17
16
  */
18
- ignored?: string | RegExp | string[];
17
+ ignored?: string[];
19
18
  /**
20
19
  * Enable polling mode for watching.
21
20
  */
@@ -36,7 +35,19 @@ export type FlatEvolveDevServerOptions = {
36
35
  * In webpack-dev-server watch mode is enabled by default.
37
36
  * This configuration will be merged into `webpack-dev-server`
38
37
  */
39
- watchOptions?: Configuration['watchOptions'];
38
+ watchOptions?: WebpackWatchOptions;
39
+ /**
40
+ * Provides the ability to execute a custom function and apply custom middleware(s).
41
+ * https://webpack.js.org/configuration/dev-server/#devserversetupmiddlewares
42
+ * @default []
43
+ */
44
+ devBeforeMiddlewares?: Middleware[];
45
+ /**
46
+ * Provides the ability to execute a custom function and apply custom middleware(s).
47
+ * https://webpack.js.org/configuration/dev-server/#devserversetupmiddlewares
48
+ * @default []
49
+ */
50
+ devAfterMiddlewares?: Middleware[];
40
51
  /**
41
52
  * Allow us costomized global serve data injected into `window.GLOBAL = {...globalData}`
42
53
  */
@@ -59,8 +59,8 @@ export interface EvolveEntryItemOption extends MultiHtmlCDNEntryItem {
59
59
  */
60
60
  mockFilters?: Array<string | RegExp>;
61
61
  /**
62
- * Extends the default `output` configuration for each entry item.
63
- * normally we use `output.library` to define the global variable name.
62
+ * Extends the default `output` configuration for each entry item, normally we use `output.library` to define the global variable name.
63
+ * Note we don't need to support react fast refresh for library target. because of the library module can not run in the browser individually.
64
64
  * @example
65
65
  * ```ts
66
66
  *'plugin-chart': {
@@ -78,11 +78,29 @@ export interface EvolveEntryItemOption extends MultiHtmlCDNEntryItem {
78
78
  * ```
79
79
  * @default undefined
80
80
  */
81
- output?: Configuration['output'];
81
+ output?: Omit<Required<Configuration>['output'], 'chunkFilename' | 'cssChunkFilename'>;
82
82
  }
83
83
  export type EvolveEntryMapContent = {
84
84
  entry: [string, ...string[]];
85
85
  options?: EvolveEntryItemOption;
86
+ /**
87
+ * An alias used when grouping builds
88
+ */
89
+ groupName?: string;
90
+ /**
91
+ * The basis of the grouping, this configuration takes effect when re-entering a group
92
+ *
93
+ * If groupingSource is `manual`, The grouping depends on the manually set groupName
94
+ *
95
+ * If groupingSource is `auto`, Grouping depends on whether the entry options are the same
96
+ *
97
+ * @default 'auto'
98
+ */
99
+ groupingSource?: 'auto' | 'manual';
100
+ /**
101
+ * The base path of the entry module
102
+ */
103
+ entryModuleBase?: string[];
86
104
  };
87
105
  export interface EvolveEntryMap {
88
106
  /**
@@ -0,0 +1,7 @@
1
+ export interface GlobalCompilerOptions {
2
+ /**
3
+ * The value indicates whether runs typescript type checker and linter on separate process.
4
+ * @default true
5
+ */
6
+ runTsChecker?: boolean;
7
+ }
@@ -0,0 +1 @@
1
+ export{};
@@ -1,6 +1,7 @@
1
+ import { type AcceptedPlugin } from 'postcss';
2
+ import { type LoaderContext } from 'webpack';
1
3
  import { type TransformOptions } from '@babel/core';
2
4
  import { type PostcssPluginPixelOptions } from '@flatjs/forge-postcss-plugin-pixel';
3
- import { type AcceptedPlugin } from 'postcss';
4
5
  import { type ModularImportOption } from './types-modular-import.js';
5
6
  export type BabelInputOptions = Pick<TransformOptions, 'presets' | 'plugins'>;
6
7
  /**
@@ -14,6 +15,34 @@ export type BuiltinBabelOptions = BabelInputOptions & {
14
15
  */
15
16
  usePreset?: 'react' | 'vue';
16
17
  };
18
+ /**
19
+ * The configurations for `css-loader` modules
20
+ * https://github.com/webpack-contrib/css-loader/blob/master/README.md#modules
21
+ */
22
+ export type CssLoaderModules = boolean | 'local' | 'global' | 'pure' | 'icss' | Partial<{
23
+ auto: boolean | RegExp | ((resourcePath: string) => boolean);
24
+ mode: 'local' | 'global' | 'pure' | 'icss' | ((resourcePath: any) => 'local' | 'global' | 'pure' | 'icss');
25
+ localIdentName: string;
26
+ localIdentContext: string;
27
+ localIdentHashSalt: string;
28
+ localIdentHashFunction: string;
29
+ localIdentHashDigest: string;
30
+ localIdentRegExp: string | RegExp;
31
+ getLocalIdent: (context: LoaderContext<any>, localIdentName: string, localName: string) => string;
32
+ namedExport: boolean;
33
+ exportGlobals: boolean;
34
+ exportLocalsConvention: 'as-is' | 'camel-case' | 'camel-case-only' | 'dashes' | 'dashes-only' | ((name: string) => string);
35
+ exportOnlyLocals: boolean;
36
+ getJSON: ({ resourcePath, imports, exports, replacements, }: {
37
+ resourcePath: string;
38
+ imports: object[];
39
+ exports: object[];
40
+ replacements: object[];
41
+ }) => Promise<void> | void;
42
+ }>;
43
+ export type CssLoaderOptions = {
44
+ modules?: CssLoaderModules;
45
+ } & Record<string, unknown>;
17
46
  /**
18
47
  * The configurations for `builtin` rule set options
19
48
  */
@@ -28,9 +57,7 @@ export interface RuleSetLoaderOptions {
28
57
  * The configurations of `css-loader`
29
58
  * https://github.com/webpack-contrib/css-loader/blob/master/README.md#modules
30
59
  */
31
- cssLoaderOptions?: {
32
- modules?: Record<string, unknown>;
33
- } & Record<string, unknown>;
60
+ cssLoaderOptions?: CssLoaderOptions;
34
61
  /**
35
62
  * The config for `Less`
36
63
  */
@@ -40,11 +67,6 @@ export interface RuleSetLoaderOptions {
40
67
  * @default []
41
68
  */
42
69
  modularImports?: ModularImportOption[];
43
- /**
44
- * The value indicates whether runs typescript type checker and linter on separate process.
45
- * @default true
46
- */
47
- runTsChecker?: boolean;
48
70
  /**
49
71
  * The configration options of `postcss-loader`
50
72
  */
@@ -2,9 +2,11 @@ import { type VerifyPackagePattern } from '@armit/package';
2
2
  import { type FlatEvolveCI } from './types-ci.js';
3
3
  import { type FlatEvolveDevServerOptions } from './types-dev-server.js';
4
4
  import { type EvolveEntryMap } from './types-entry-map.js';
5
+ import { type GlobalCompilerOptions } from './types-global-compiler-options.js';
5
6
  import { type RuleSetLoaderOptions } from './types-loader-options.js';
6
- import { type EvolveMultiCDNEnvResolver, type EvolveMultiCDNConfig } from './types-multi-html.js';
7
+ import { type EvolveMultiCDNConfig, type EvolveMultiCDNEnvResolver } from './types-multi-html.js';
7
8
  import { type EvolvePluginOptions } from './types-plugin-options.js';
9
+ import { type ThreadsOptions } from './types-threads-options.js';
8
10
  import { type FlatEvolveWebpackOptions } from './types-webpack.js';
9
11
  /**
10
12
  * Detect locally installed dependencies that have correctly installed from `package.json` declared version `dependencies`
@@ -44,6 +46,10 @@ export interface FlatEvolveOptions {
44
46
  * The configurations of `webpack`
45
47
  */
46
48
  webpack?: FlatEvolveWebpackOptions;
49
+ /**
50
+ * The config options of global webpack compiler.
51
+ */
52
+ globalCompilerOptions?: GlobalCompilerOptions;
47
53
  /**
48
54
  * The config options of all rule set loaders.
49
55
  */
@@ -96,20 +102,9 @@ export interface FlatEvolveOptions {
96
102
  /**
97
103
  * All webpack entries configuration
98
104
  */
99
- entryMap: EvolveEntryMap;
100
- /**
101
- * Visualize size of webpack output files with an interactive zoomable treemap.
102
- */
103
- analyzer?: Record<string, unknown>;
104
- /**
105
- * Maximum number of process to run at once for production build
106
- * Exact number or a percent of CPUs available (for example "50%").
107
- *
108
- * If undefined, then all build processes will start in parallel.
109
- * Setting this value to 1 will achieve sequential running.
110
- * @default 5
111
- */
112
- maxProcesses?: number | string;
105
+ entryMap: {
106
+ [K in keyof EvolveEntryMap]: Omit<EvolveEntryMap[K], 'groupingSource'>;
107
+ };
113
108
  /**
114
109
  * For `production` mode, the value indicates if we interrupt compilation process while received "warnings" while evolve `build`
115
110
  * @default false
@@ -119,4 +114,24 @@ export interface FlatEvolveOptions {
119
114
  * The faster builds, simplified ci pipeline configurations
120
115
  */
121
116
  ci?: FlatEvolveCI;
117
+ /**
118
+ * The configurations of `threads`
119
+ */
120
+ threads?: ThreadsOptions;
121
+ /**
122
+ * Control whether each entry is built independently.
123
+ *
124
+ * If `true`, each entry will be built independently.
125
+ *
126
+ * If `false`, each entries are grouped according to certain rules
127
+ *
128
+ * @default false
129
+ */
130
+ isolation?: boolean;
131
+ /**
132
+ * The maximum size of an entry group.
133
+ *
134
+ * @default 10
135
+ */
136
+ maxEntryGroupSize?: number;
122
137
  }
@@ -0,0 +1,18 @@
1
+ export interface ThreadsOptions {
2
+ /**
3
+ * Minimum number of process to run at once for production build
4
+ *
5
+ * @default 1
6
+ */
7
+ minThreads?: number;
8
+ /**
9
+ * Maximum number of process to run at once for production build
10
+ */
11
+ maxThreads?: number;
12
+ /**
13
+ * Default timeout to wait for close when Thread shuts down, in milliseconds
14
+ *
15
+ * @default 60000
16
+ */
17
+ idleTimeout?: number;
18
+ }
@@ -0,0 +1 @@
1
+ export{};
@@ -1,4 +1,4 @@
1
- import { type RuleSetRule, type Configuration } from 'webpack';
1
+ import { type Configuration, type RuleSetRule } from 'webpack';
2
2
  import { type WebpackPlugin } from '../create-webpack/types.js';
3
3
  import { type TerserMinimizerOptions } from '../minimizer/types.js';
4
4
  /**
@@ -62,7 +62,10 @@ export interface FlatEvolveWebpackOptions extends Pick<Configuration, 'performan
62
62
  * @default `terser` minimizer has been enabled fro `production`
63
63
  */
64
64
  minimizer?: false | {
65
- terserOptions?: TerserMinimizerOptions;
65
+ /**
66
+ * Allow to disable terser minimizer. or customized terser options.
67
+ */
68
+ terserOptions?: false | TerserMinimizerOptions;
66
69
  /**
67
70
  * @default false
68
71
  */