@roots/bud-build 6.12.2 → 6.13.0

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 (265) hide show
  1. package/lib/config/bail.d.ts +0 -1
  2. package/lib/config/bail.js +0 -1
  3. package/lib/config/cache.d.ts +0 -1
  4. package/lib/config/cache.js +0 -1
  5. package/lib/config/context.d.ts +0 -1
  6. package/lib/config/context.js +0 -1
  7. package/lib/config/dependencies.d.ts +0 -1
  8. package/lib/config/dependencies.js +0 -1
  9. package/lib/config/devtool.d.ts +0 -1
  10. package/lib/config/devtool.js +0 -1
  11. package/lib/config/entry.d.ts +0 -1
  12. package/lib/config/entry.js +0 -1
  13. package/lib/config/experiments.d.ts +0 -1
  14. package/lib/config/experiments.js +3 -2
  15. package/lib/config/externals.d.ts +0 -1
  16. package/lib/config/externals.js +0 -1
  17. package/lib/config/externalsType.d.ts +0 -1
  18. package/lib/config/externalsType.js +1 -2
  19. package/lib/config/index.d.ts +0 -1
  20. package/lib/config/index.js +0 -1
  21. package/lib/config/infrastructureLogging.d.ts +0 -1
  22. package/lib/config/infrastructureLogging.js +0 -1
  23. package/lib/config/loader.d.ts +0 -1
  24. package/lib/config/loader.js +0 -1
  25. package/lib/config/mode.d.ts +0 -1
  26. package/lib/config/mode.js +0 -1
  27. package/lib/config/module.d.ts +0 -1
  28. package/lib/config/module.js +5 -2
  29. package/lib/config/name.d.ts +0 -1
  30. package/lib/config/name.js +0 -1
  31. package/lib/config/node.d.ts +0 -1
  32. package/lib/config/node.js +0 -1
  33. package/lib/config/optimization.d.ts +0 -1
  34. package/lib/config/optimization.js +13 -4
  35. package/lib/config/output/assetModuleFilename.d.ts +0 -1
  36. package/lib/config/output/assetModuleFilename.js +0 -1
  37. package/lib/config/output/chunkFilename.d.ts +0 -1
  38. package/lib/config/output/chunkFilename.js +0 -1
  39. package/lib/config/output/filename.d.ts +0 -1
  40. package/lib/config/output/filename.js +0 -1
  41. package/lib/config/output/index.d.ts +0 -1
  42. package/lib/config/output/index.js +1 -2
  43. package/lib/config/parallelism.d.ts +0 -1
  44. package/lib/config/parallelism.js +0 -1
  45. package/lib/config/performance.d.ts +0 -1
  46. package/lib/config/performance.js +1 -2
  47. package/lib/config/plugins.d.ts +0 -1
  48. package/lib/config/plugins.js +0 -1
  49. package/lib/config/profile.d.ts +0 -1
  50. package/lib/config/profile.js +1 -2
  51. package/lib/config/recordsPath.d.ts +0 -1
  52. package/lib/config/recordsPath.js +0 -1
  53. package/lib/config/resolve.d.ts +0 -1
  54. package/lib/config/resolve.js +19 -28
  55. package/lib/config/resolveLoader.d.ts +0 -1
  56. package/lib/config/resolveLoader.js +2 -3
  57. package/lib/config/snapshot.d.ts +0 -1
  58. package/lib/config/snapshot.js +8 -4
  59. package/lib/config/stats.d.ts +0 -1
  60. package/lib/config/stats.js +0 -1
  61. package/lib/config/target.d.ts +0 -1
  62. package/lib/config/target.js +0 -1
  63. package/lib/handlers/index.d.ts +0 -1
  64. package/lib/handlers/index.js +0 -1
  65. package/lib/handlers/items/items.d.ts +0 -1
  66. package/lib/handlers/items/items.js +1 -2
  67. package/lib/handlers/loaders/loaders.d.ts +0 -1
  68. package/lib/handlers/loaders/loaders.js +0 -1
  69. package/lib/handlers/register.d.ts +0 -1
  70. package/lib/handlers/register.js +0 -1
  71. package/lib/handlers/rules/css.d.ts +0 -1
  72. package/lib/handlers/rules/css.js +0 -1
  73. package/lib/handlers/rules/css.module.d.ts +0 -1
  74. package/lib/handlers/rules/css.module.js +0 -1
  75. package/lib/handlers/rules/csv.d.ts +0 -1
  76. package/lib/handlers/rules/csv.js +0 -1
  77. package/lib/handlers/rules/font.d.ts +0 -1
  78. package/lib/handlers/rules/font.inline.d.ts +0 -1
  79. package/lib/handlers/rules/font.inline.js +0 -1
  80. package/lib/handlers/rules/font.js +0 -1
  81. package/lib/handlers/rules/html.d.ts +0 -1
  82. package/lib/handlers/rules/html.js +0 -1
  83. package/lib/handlers/rules/image.d.ts +0 -1
  84. package/lib/handlers/rules/image.inline.d.ts +0 -1
  85. package/lib/handlers/rules/image.inline.js +0 -1
  86. package/lib/handlers/rules/image.js +0 -1
  87. package/lib/handlers/rules/index.d.ts +0 -1
  88. package/lib/handlers/rules/index.js +0 -1
  89. package/lib/handlers/rules/js.d.ts +0 -1
  90. package/lib/handlers/rules/js.js +3 -2
  91. package/lib/handlers/rules/json.d.ts +0 -1
  92. package/lib/handlers/rules/json.js +3 -2
  93. package/lib/handlers/rules/svg.d.ts +0 -1
  94. package/lib/handlers/rules/svg.inline.d.ts +0 -1
  95. package/lib/handlers/rules/svg.inline.js +0 -1
  96. package/lib/handlers/rules/svg.js +0 -1
  97. package/lib/handlers/rules/toml.d.ts +0 -1
  98. package/lib/handlers/rules/toml.js +3 -2
  99. package/lib/handlers/rules/webp.d.ts +0 -1
  100. package/lib/handlers/rules/webp.js +0 -1
  101. package/lib/handlers/rules/xml.d.ts +0 -1
  102. package/lib/handlers/rules/xml.js +0 -1
  103. package/lib/handlers/rules/yml.d.ts +0 -1
  104. package/lib/handlers/rules/yml.js +0 -1
  105. package/lib/helpers/isMjs.d.ts +0 -1
  106. package/lib/helpers/isMjs.js +0 -1
  107. package/lib/helpers/scriptExtension.d.ts +0 -1
  108. package/lib/helpers/scriptExtension.js +0 -1
  109. package/lib/index.d.ts +4 -1
  110. package/lib/index.js +4 -1
  111. package/lib/item/index.d.ts +0 -1
  112. package/lib/item/index.js +14 -2
  113. package/lib/loader/index.d.ts +0 -1
  114. package/lib/loader/index.js +5 -1
  115. package/lib/rule/index.d.ts +32 -21
  116. package/lib/rule/index.js +76 -16
  117. package/lib/service.d.ts +11 -11
  118. package/lib/service.js +58 -62
  119. package/lib/shared/base.d.ts +0 -1
  120. package/lib/shared/base.js +2 -2
  121. package/lib/types.d.ts +0 -1
  122. package/lib/types.js +0 -1
  123. package/package.json +11 -6
  124. package/src/config/experiments.ts +3 -1
  125. package/src/config/externalsType.ts +2 -1
  126. package/src/config/index.test.ts +4 -4
  127. package/src/config/module.ts +5 -1
  128. package/src/config/optimization.ts +21 -1
  129. package/src/config/output/index.ts +1 -1
  130. package/src/config/performance.ts +1 -1
  131. package/src/config/profile.ts +2 -2
  132. package/src/config/resolve.ts +27 -41
  133. package/src/config/resolveLoader.ts +3 -3
  134. package/src/config/snapshot.ts +21 -4
  135. package/src/handlers/items/items.ts +1 -1
  136. package/src/handlers/rules/js.ts +3 -1
  137. package/src/handlers/rules/json.ts +3 -1
  138. package/src/handlers/rules/toml.ts +3 -1
  139. package/src/index.ts +5 -0
  140. package/src/item/index.ts +1 -1
  141. package/src/rule/index.ts +51 -23
  142. package/src/service.ts +31 -30
  143. package/src/shared/base.ts +1 -1
  144. package/lib/config/bail.d.ts.map +0 -1
  145. package/lib/config/bail.js.map +0 -1
  146. package/lib/config/cache.d.ts.map +0 -1
  147. package/lib/config/cache.js.map +0 -1
  148. package/lib/config/context.d.ts.map +0 -1
  149. package/lib/config/context.js.map +0 -1
  150. package/lib/config/dependencies.d.ts.map +0 -1
  151. package/lib/config/dependencies.js.map +0 -1
  152. package/lib/config/devtool.d.ts.map +0 -1
  153. package/lib/config/devtool.js.map +0 -1
  154. package/lib/config/entry.d.ts.map +0 -1
  155. package/lib/config/entry.js.map +0 -1
  156. package/lib/config/experiments.d.ts.map +0 -1
  157. package/lib/config/experiments.js.map +0 -1
  158. package/lib/config/externals.d.ts.map +0 -1
  159. package/lib/config/externals.js.map +0 -1
  160. package/lib/config/externalsType.d.ts.map +0 -1
  161. package/lib/config/externalsType.js.map +0 -1
  162. package/lib/config/index.d.ts.map +0 -1
  163. package/lib/config/index.js.map +0 -1
  164. package/lib/config/infrastructureLogging.d.ts.map +0 -1
  165. package/lib/config/infrastructureLogging.js.map +0 -1
  166. package/lib/config/loader.d.ts.map +0 -1
  167. package/lib/config/loader.js.map +0 -1
  168. package/lib/config/mode.d.ts.map +0 -1
  169. package/lib/config/mode.js.map +0 -1
  170. package/lib/config/module.d.ts.map +0 -1
  171. package/lib/config/module.js.map +0 -1
  172. package/lib/config/name.d.ts.map +0 -1
  173. package/lib/config/name.js.map +0 -1
  174. package/lib/config/node.d.ts.map +0 -1
  175. package/lib/config/node.js.map +0 -1
  176. package/lib/config/optimization.d.ts.map +0 -1
  177. package/lib/config/optimization.js.map +0 -1
  178. package/lib/config/output/assetModuleFilename.d.ts.map +0 -1
  179. package/lib/config/output/assetModuleFilename.js.map +0 -1
  180. package/lib/config/output/chunkFilename.d.ts.map +0 -1
  181. package/lib/config/output/chunkFilename.js.map +0 -1
  182. package/lib/config/output/filename.d.ts.map +0 -1
  183. package/lib/config/output/filename.js.map +0 -1
  184. package/lib/config/output/index.d.ts.map +0 -1
  185. package/lib/config/output/index.js.map +0 -1
  186. package/lib/config/parallelism.d.ts.map +0 -1
  187. package/lib/config/parallelism.js.map +0 -1
  188. package/lib/config/performance.d.ts.map +0 -1
  189. package/lib/config/performance.js.map +0 -1
  190. package/lib/config/plugins.d.ts.map +0 -1
  191. package/lib/config/plugins.js.map +0 -1
  192. package/lib/config/profile.d.ts.map +0 -1
  193. package/lib/config/profile.js.map +0 -1
  194. package/lib/config/recordsPath.d.ts.map +0 -1
  195. package/lib/config/recordsPath.js.map +0 -1
  196. package/lib/config/resolve.d.ts.map +0 -1
  197. package/lib/config/resolve.js.map +0 -1
  198. package/lib/config/resolveLoader.d.ts.map +0 -1
  199. package/lib/config/resolveLoader.js.map +0 -1
  200. package/lib/config/snapshot.d.ts.map +0 -1
  201. package/lib/config/snapshot.js.map +0 -1
  202. package/lib/config/stats.d.ts.map +0 -1
  203. package/lib/config/stats.js.map +0 -1
  204. package/lib/config/target.d.ts.map +0 -1
  205. package/lib/config/target.js.map +0 -1
  206. package/lib/handlers/index.d.ts.map +0 -1
  207. package/lib/handlers/index.js.map +0 -1
  208. package/lib/handlers/items/items.d.ts.map +0 -1
  209. package/lib/handlers/items/items.js.map +0 -1
  210. package/lib/handlers/loaders/loaders.d.ts.map +0 -1
  211. package/lib/handlers/loaders/loaders.js.map +0 -1
  212. package/lib/handlers/register.d.ts.map +0 -1
  213. package/lib/handlers/register.js.map +0 -1
  214. package/lib/handlers/rules/css.d.ts.map +0 -1
  215. package/lib/handlers/rules/css.js.map +0 -1
  216. package/lib/handlers/rules/css.module.d.ts.map +0 -1
  217. package/lib/handlers/rules/css.module.js.map +0 -1
  218. package/lib/handlers/rules/csv.d.ts.map +0 -1
  219. package/lib/handlers/rules/csv.js.map +0 -1
  220. package/lib/handlers/rules/font.d.ts.map +0 -1
  221. package/lib/handlers/rules/font.inline.d.ts.map +0 -1
  222. package/lib/handlers/rules/font.inline.js.map +0 -1
  223. package/lib/handlers/rules/font.js.map +0 -1
  224. package/lib/handlers/rules/html.d.ts.map +0 -1
  225. package/lib/handlers/rules/html.js.map +0 -1
  226. package/lib/handlers/rules/image.d.ts.map +0 -1
  227. package/lib/handlers/rules/image.inline.d.ts.map +0 -1
  228. package/lib/handlers/rules/image.inline.js.map +0 -1
  229. package/lib/handlers/rules/image.js.map +0 -1
  230. package/lib/handlers/rules/index.d.ts.map +0 -1
  231. package/lib/handlers/rules/index.js.map +0 -1
  232. package/lib/handlers/rules/js.d.ts.map +0 -1
  233. package/lib/handlers/rules/js.js.map +0 -1
  234. package/lib/handlers/rules/json.d.ts.map +0 -1
  235. package/lib/handlers/rules/json.js.map +0 -1
  236. package/lib/handlers/rules/svg.d.ts.map +0 -1
  237. package/lib/handlers/rules/svg.inline.d.ts.map +0 -1
  238. package/lib/handlers/rules/svg.inline.js.map +0 -1
  239. package/lib/handlers/rules/svg.js.map +0 -1
  240. package/lib/handlers/rules/toml.d.ts.map +0 -1
  241. package/lib/handlers/rules/toml.js.map +0 -1
  242. package/lib/handlers/rules/webp.d.ts.map +0 -1
  243. package/lib/handlers/rules/webp.js.map +0 -1
  244. package/lib/handlers/rules/xml.d.ts.map +0 -1
  245. package/lib/handlers/rules/xml.js.map +0 -1
  246. package/lib/handlers/rules/yml.d.ts.map +0 -1
  247. package/lib/handlers/rules/yml.js.map +0 -1
  248. package/lib/helpers/isMjs.d.ts.map +0 -1
  249. package/lib/helpers/isMjs.js.map +0 -1
  250. package/lib/helpers/scriptExtension.d.ts.map +0 -1
  251. package/lib/helpers/scriptExtension.js.map +0 -1
  252. package/lib/index.d.ts.map +0 -1
  253. package/lib/index.js.map +0 -1
  254. package/lib/item/index.d.ts.map +0 -1
  255. package/lib/item/index.js.map +0 -1
  256. package/lib/loader/index.d.ts.map +0 -1
  257. package/lib/loader/index.js.map +0 -1
  258. package/lib/rule/index.d.ts.map +0 -1
  259. package/lib/rule/index.js.map +0 -1
  260. package/lib/service.d.ts.map +0 -1
  261. package/lib/service.js.map +0 -1
  262. package/lib/shared/base.d.ts.map +0 -1
  263. package/lib/shared/base.js.map +0 -1
  264. package/lib/types.d.ts.map +0 -1
  265. package/lib/types.js.map +0 -1
@@ -1,3 +1,2 @@
1
1
  import type { Factory } from './index.js';
2
2
  export declare const bail: Factory<'bail'>;
3
- //# sourceMappingURL=bail.d.ts.map
@@ -1,2 +1 @@
1
1
  export const bail = async ({ hooks, isProduction }) => hooks.filter(`build.bail`, isProduction);
2
- //# sourceMappingURL=bail.js.map
@@ -1,3 +1,2 @@
1
1
  import type { Factory } from './index.js';
2
2
  export declare const cache: Factory<`cache`>;
3
- //# sourceMappingURL=cache.d.ts.map
@@ -1,2 +1 @@
1
1
  export const cache = async ({ cache, hooks }) => hooks.filter(`build.cache`, cache.configuration);
2
- //# sourceMappingURL=cache.js.map
@@ -1,3 +1,2 @@
1
1
  import type { Factory } from './index.js';
2
2
  export declare const context: Factory<`context`>;
3
- //# sourceMappingURL=context.d.ts.map
@@ -1,2 +1 @@
1
1
  export const context = async ({ path }) => path(`@src`);
2
- //# sourceMappingURL=context.js.map
@@ -1,3 +1,2 @@
1
1
  import type { Factory } from './index.js';
2
2
  export declare const dependencies: Factory<`dependencies`>;
3
- //# sourceMappingURL=dependencies.d.ts.map
@@ -2,4 +2,3 @@ import isUndefined from '@roots/bud-support/lodash/isUndefined';
2
2
  export const dependencies = async ({ hooks, root, }) => hooks
3
3
  .filter(`build.dependencies`, [])
4
4
  .filter(label => !isUndefined(root.children[label]));
5
- //# sourceMappingURL=dependencies.js.map
@@ -1,3 +1,2 @@
1
1
  import type { Factory } from './index.js';
2
2
  export declare const devtool: Factory<`devtool`>;
3
- //# sourceMappingURL=devtool.d.ts.map
@@ -1,2 +1 @@
1
1
  export const devtool = async ({ hooks }) => hooks.filter(`build.devtool`, false);
2
- //# sourceMappingURL=devtool.js.map
@@ -1,3 +1,2 @@
1
1
  import type { Factory } from './index.js';
2
2
  export declare const entry: Factory<`entry`>;
3
- //# sourceMappingURL=entry.d.ts.map
@@ -1,2 +1 @@
1
1
  export const entry = async ({ hooks }) => hooks.filter(`build.entry`, { main: { import: [`index`] } });
2
- //# sourceMappingURL=entry.js.map
@@ -1,3 +1,2 @@
1
1
  import type { Factory } from './index.js';
2
2
  export declare const experiments: Factory<`experiments`>;
3
- //# sourceMappingURL=experiments.d.ts.map
@@ -1,2 +1,3 @@
1
- export const experiments = async ({ hooks }) => hooks.filter(`build.experiments`, undefined);
2
- //# sourceMappingURL=experiments.js.map
1
+ export const experiments = async ({ hooks }) => hooks.filter(`build.experiments`, {
2
+ backCompat: false,
3
+ });
@@ -1,3 +1,2 @@
1
1
  import type { Factory } from './index.js';
2
2
  export declare const externals: Factory<`externals`>;
3
- //# sourceMappingURL=externals.d.ts.map
@@ -1,2 +1 @@
1
1
  export const externals = async (app) => app.hooks.filter(`build.externals`, undefined);
2
- //# sourceMappingURL=externals.js.map
@@ -1,3 +1,2 @@
1
1
  import type { Factory } from './index.js';
2
2
  export declare const externalsType: Factory<`externalsType`>;
3
- //# sourceMappingURL=externalsType.d.ts.map
@@ -1,2 +1 @@
1
- export const externalsType = async (app) => `var`;
2
- //# sourceMappingURL=externalsType.js.map
1
+ export const externalsType = async (app) => undefined;
@@ -34,4 +34,3 @@ export interface Factory<Key extends keyof Config, Config = Configuration> {
34
34
  export type Records<Config = Configuration> = {
35
35
  [Key in keyof Config as `${Key & string}`]: Factory<Key, Config>;
36
36
  };
37
- //# sourceMappingURL=index.d.ts.map
@@ -26,4 +26,3 @@ import { snapshot } from './snapshot.js';
26
26
  import { stats } from './stats.js';
27
27
  import { target } from './target.js';
28
28
  export { bail, cache, context, dependencies, devtool, entry, experiments, externals, externalsType, infrastructureLogging, loader, mode, module, name, node, optimization, output, parallelism, performance, plugins, profile, recordsPath, resolve, resolveLoader, snapshot, stats, target, };
29
- //# sourceMappingURL=index.js.map
@@ -1,3 +1,2 @@
1
1
  import type { Factory } from './index.js';
2
2
  export declare const infrastructureLogging: Factory<`infrastructureLogging`>;
3
- //# sourceMappingURL=infrastructureLogging.d.ts.map
@@ -17,4 +17,3 @@ export const infrastructureLogging = async (bud) => bud.hooks.filter(`build.infr
17
17
  }),
18
18
  level: bud.hooks.filter(`build.infrastructureLogging.level`, `log`),
19
19
  });
20
- //# sourceMappingURL=infrastructureLogging.js.map
@@ -1,3 +1,2 @@
1
1
  import type { Factory } from './index.js';
2
2
  export declare const loader: Factory<`loader`>;
3
- //# sourceMappingURL=loader.d.ts.map
@@ -1,2 +1 @@
1
1
  export const loader = async (app) => app.hooks.filter(`build.loader`);
2
- //# sourceMappingURL=loader.js.map
@@ -1,3 +1,2 @@
1
1
  import type { Factory } from './index.js';
2
2
  export declare const mode: Factory<`mode`>;
3
- //# sourceMappingURL=mode.d.ts.map
@@ -1,2 +1 @@
1
1
  export const mode = async (bud) => bud.hooks.filter(`build.mode`, bud.mode);
2
- //# sourceMappingURL=mode.js.map
@@ -1,3 +1,2 @@
1
1
  import type { Factory } from './index.js';
2
2
  export declare const module: Factory<`module`>;
3
- //# sourceMappingURL=module.d.ts.map
@@ -19,5 +19,8 @@ const getRules = ({ filter, path, rules }) => [
19
19
  ...filter(`build.module.rules.after`, []),
20
20
  ];
21
21
  const getNoParse = (filter) => filter(`build.module.noParse`, undefined);
22
- const getUnsafeCache = (filter) => filter(`build.module.unsafeCache`, false);
23
- //# sourceMappingURL=module.js.map
22
+ /**
23
+ * By leaving undefined, webpack will strongly cache parsed modules from node_modules
24
+ * but leave the rest. This is the default behavior.
25
+ */
26
+ const getUnsafeCache = (filter) => filter(`build.module.unsafeCache`, undefined);
@@ -1,3 +1,2 @@
1
1
  import type { Factory } from './index.js';
2
2
  export declare const name: Factory<`name`>;
3
- //# sourceMappingURL=name.d.ts.map
@@ -1,2 +1 @@
1
1
  export const name = async ({ hooks, label }) => hooks.filter(`build.name`, label);
2
- //# sourceMappingURL=name.js.map
@@ -1,3 +1,2 @@
1
1
  import type { Factory } from './index.js';
2
2
  export declare const node: Factory<`node`>;
3
- //# sourceMappingURL=node.d.ts.map
@@ -1,2 +1 @@
1
1
  export const node = async ({ hooks }) => hooks.filter(`build.node`, false);
2
- //# sourceMappingURL=node.js.map
@@ -1,3 +1,2 @@
1
1
  import type { Factory } from './index.js';
2
2
  export declare const optimization: Factory<`optimization`>;
3
- //# sourceMappingURL=optimization.d.ts.map
@@ -1,11 +1,20 @@
1
- export const optimization = async ({ hooks: { filter }, isDevelopment, isProduction, }) => filter(`build.optimization`, {
1
+ export const optimization = async ({ hooks: { filter }, isDevelopment, isProduction, mode, }) => filter(`build.optimization`, {
2
2
  emitOnErrors: filter(`build.optimization.emitOnErrors`, isDevelopment),
3
+ innerGraph: filter(`build.optimization.innerGraph`, isProduction),
4
+ mergeDuplicateChunks: filter(`build.optimization.mergeDuplicateChunks`, isProduction),
3
5
  minimize: filter(`build.optimization.minimize`, isProduction),
4
6
  minimizer: filter(`build.optimization.minimizer`, []),
5
7
  moduleIds: filter(`build.optimization.moduleIds`, `named`),
6
- removeEmptyChunks: filter(`build.optimization.removeEmptyChunks`, false),
7
- runtimeChunk: filter(`build.optimization.runtimeChunk`, false),
8
+ nodeEnv: filter(`build.optimization.nodeEnv`, mode),
9
+ removeEmptyChunks: filter(`build.optimization.removeEmptyChunks`, isProduction),
10
+ /**
11
+ * Will be new default in webpack 6
12
+ * @see {@link https://webpack.js.org/configuration/optimization/#optimizationremoveavailablemodules}
13
+ */
14
+ removeAvailableModules: filter(`build.optimization.removeAvailableModules`, false),
15
+ runtimeChunk: filter(`build.optimization.runtimeChunk`, `single`),
16
+ sideEffects: filter(`build.optimization.sideEffects`, isProduction),
8
17
  splitChunks: filter(`build.optimization.splitChunks`, false),
18
+ providedExports: filter(`build.optimization.providedExports`, isProduction),
9
19
  usedExports: filter(`build.optimization.usedExports`, isProduction),
10
20
  });
11
- //# sourceMappingURL=optimization.js.map
@@ -5,4 +5,3 @@ interface Props {
5
5
  }
6
6
  export declare const assetModuleFilename: ({ filter, relPath }: Props) => string | ((pathData: import("webpack").PathData, assetInfo?: import("webpack").AssetInfo) => string);
7
7
  export {};
8
- //# sourceMappingURL=assetModuleFilename.d.ts.map
@@ -1,2 +1 @@
1
1
  export const assetModuleFilename = ({ filter, relPath }) => filter(`build.output.assetModuleFilename`, relPath(`@file`));
2
- //# sourceMappingURL=assetModuleFilename.js.map
@@ -5,4 +5,3 @@ interface Props {
5
5
  }
6
6
  export declare const chunkFilename: ({ filter, relPath }: Props) => string | ((pathData: import("webpack").PathData, assetInfo?: import("webpack").AssetInfo) => string);
7
7
  export {};
8
- //# sourceMappingURL=chunkFilename.d.ts.map
@@ -1,4 +1,3 @@
1
1
  import { join } from 'node:path';
2
2
  import { scriptExtension } from '../../helpers/scriptExtension.js';
3
3
  export const chunkFilename = ({ filter, relPath }) => filter(`build.output.chunkFilename`, join(`js`, `dynamic`, relPath(`@name.chunk`)).concat(scriptExtension(filter, `.mjs`, `.js`)));
4
- //# sourceMappingURL=chunkFilename.js.map
@@ -5,4 +5,3 @@ interface Props {
5
5
  }
6
6
  export declare const filename: ({ filter, relPath }: Props) => string | ((pathData: import("webpack").PathData, assetInfo?: import("webpack").AssetInfo) => string);
7
7
  export {};
8
- //# sourceMappingURL=filename.d.ts.map
@@ -1,3 +1,2 @@
1
1
  import { scriptExtension } from '../../helpers/scriptExtension.js';
2
2
  export const filename = ({ filter, relPath }) => filter(`build.output.filename`, relPath(`js`, `@name${scriptExtension(filter, `.mjs`, `.js`)}`));
3
- //# sourceMappingURL=filename.js.map
@@ -1,3 +1,2 @@
1
1
  import type { Factory } from '../index.js';
2
2
  export declare const output: Factory<`output`>;
3
- //# sourceMappingURL=index.d.ts.map
@@ -10,9 +10,8 @@ export const output = async ({ hooks: { filter }, isProduction, path, relPath, }
10
10
  filename: filename({ filter, relPath }),
11
11
  module: filter(`build.output.module`, false),
12
12
  path: filter(`build.output.path`, path(`@dist`)),
13
- pathinfo: filter(`build.output.pathinfo`),
13
+ pathinfo: filter(`build.output.pathinfo`, false),
14
14
  publicPath: filter(`build.output.publicPath`, `auto`),
15
15
  scriptType: filter(`build.output.scriptType`, isMjs(filter) ? `module` : false),
16
16
  uniqueName: filter(`build.output.uniqueName`, `@roots/bud`),
17
17
  });
18
- //# sourceMappingURL=index.js.map
@@ -1,3 +1,2 @@
1
1
  import type { Factory } from './index.js';
2
2
  export declare const parallelism: Factory<`parallelism`>;
3
- //# sourceMappingURL=parallelism.d.ts.map
@@ -1,3 +1,2 @@
1
1
  import { cpus } from 'node:os';
2
2
  export const parallelism = async ({ hooks }) => hooks.filter(`build.parallelism`, 10 * Math.max(cpus().length - 1, 1));
3
- //# sourceMappingURL=parallelism.js.map
@@ -1,3 +1,2 @@
1
1
  import type { Factory } from './index.js';
2
2
  export declare const performance: Factory<`performance`>;
3
- //# sourceMappingURL=performance.d.ts.map
@@ -1,2 +1 @@
1
- export const performance = async ({ hooks }) => hooks.filter(`build.performance`, { hints: false });
2
- //# sourceMappingURL=performance.js.map
1
+ export const performance = async ({ hooks }) => hooks.filter(`build.performance`, false);
@@ -1,3 +1,2 @@
1
1
  import type { Factory } from './index.js';
2
2
  export declare const plugins: Factory<`plugins`>;
3
- //# sourceMappingURL=plugins.d.ts.map
@@ -1,2 +1 @@
1
1
  export const plugins = async (app) => await app.hooks.filterAsync(`build.plugins`, await app.extensions.make());
2
- //# sourceMappingURL=plugins.js.map
@@ -1,3 +1,2 @@
1
1
  import type { Factory } from './index.js';
2
2
  export declare const profile: Factory<`profile`>;
3
- //# sourceMappingURL=profile.d.ts.map
@@ -1,2 +1 @@
1
- export const profile = async (app) => app.hooks.filter(`build.profile`, undefined);
2
- //# sourceMappingURL=profile.js.map
1
+ export const profile = async (bud) => bud.hooks.filter(`build.profile`, bud.context.debug);
@@ -1,3 +1,2 @@
1
1
  import type { Factory } from './index.js';
2
2
  export declare const recordsPath: Factory<`recordsPath`>;
3
- //# sourceMappingURL=recordsPath.d.ts.map
@@ -1,2 +1 @@
1
1
  export const recordsPath = async (bud) => bud.hooks.filter(`build.recordsPath`, bud.path(`@storage`, bud.label, `modules.json`));
2
- //# sourceMappingURL=recordsPath.js.map
@@ -1,3 +1,2 @@
1
1
  import type { Factory } from './index.js';
2
2
  export declare const resolve: Factory<`resolve`>;
3
- //# sourceMappingURL=resolve.d.ts.map
@@ -1,30 +1,21 @@
1
1
  export const resolve = async (bud) => {
2
- const modules = await getModules(bud);
3
- const value = {
4
- alias: await getAlias(bud),
5
- extensions: getExtensions(bud),
6
- modules,
7
- };
8
- return await bud.hooks.filterAsync(`build.resolve`, value);
2
+ return await bud.hooks.filterAsync(`build.resolve`, {
3
+ alias: {
4
+ [`@src`]: bud.path(`@src`),
5
+ ...(await bud.hooks.filterAsync(`build.resolve.alias`, {})),
6
+ },
7
+ extensionAlias: await bud.hooks.filterAsync(`build.resolve.extensionAlias`, {
8
+ [`.js`]: [`.ts`, `.tsx`, `.js`],
9
+ [`.mjs`]: [`.mts`, `.mtx`, `.mjs`],
10
+ }),
11
+ extensions: Array.from(bud.hooks.filter(`build.resolve.extensions`, new Set([`.js`, `.mjs`, `.jsx`, `.css`]))),
12
+ modules: await bud.hooks.filterAsync(`build.resolve.modules`, [
13
+ bud.hooks.filter(`location.@src`),
14
+ bud.hooks.filter(`location.@modules`),
15
+ ]),
16
+ /**
17
+ * Leave `undefined` to use webpack default (true in dev, false in production)
18
+ */
19
+ unsafeCache: bud.hooks.filter(`build.module.unsafeCache`, undefined),
20
+ });
9
21
  };
10
- const getAlias = async (bud) => await bud.hooks.filterAsync(`build.resolve.alias`, {
11
- '@src': bud.path(`@src`),
12
- });
13
- const getExtensions = (bud) => Array.from(bud.hooks.filter(`build.resolve.extensions`, new Set([
14
- `.mjs`,
15
- `.js`,
16
- `.jsx`,
17
- `.css`,
18
- `.json`,
19
- `.wasm`,
20
- `.yml`,
21
- `.yaml`,
22
- `.xml`,
23
- `.toml`,
24
- `.csv`,
25
- ])));
26
- const getModules = async (bud) => await bud.hooks.filterAsync(`build.resolve.modules`, [
27
- bud.hooks.filter(`location.@src`),
28
- bud.hooks.filter(`location.@modules`),
29
- ]);
30
- //# sourceMappingURL=resolve.js.map
@@ -1,3 +1,2 @@
1
1
  import type { Factory } from './index.js';
2
2
  export declare const resolveLoader: Factory<`resolveLoader`>;
3
- //# sourceMappingURL=resolveLoader.d.ts.map
@@ -1,4 +1,3 @@
1
- export const resolveLoader = async (bud) => bud.hooks.filter(`build.resolveLoader`, {
2
- alias: {},
1
+ export const resolveLoader = async ({ hooks }) => hooks.filter(`build.resolveLoader`, {
2
+ alias: hooks.filter(`build.resolveLoader.alias`, {}),
3
3
  });
4
- //# sourceMappingURL=resolveLoader.js.map
@@ -1,3 +1,2 @@
1
1
  import type { Factory } from './index.js';
2
2
  export declare const snapshot: Factory<`snapshot`>;
3
- //# sourceMappingURL=snapshot.d.ts.map
@@ -1,6 +1,10 @@
1
- export const snapshot = async (app) => app.hooks.filter(`build.snapshot`, {
2
- managedPaths: app.hooks.filter(`build.snapshot.managedPaths`, [
3
- ...new Set([app.path(`@modules`)]),
1
+ export const snapshot = async ({ env, hooks, path }) => hooks.filter(`build.snapshot`, {
2
+ immutablePaths: hooks.filter(`build.snapshot.immutablePaths`, []),
3
+ managedPaths: hooks.filter(`build.snapshot.managedPaths`, [
4
+ ...new Set([path(`@modules`)]),
4
5
  ]),
6
+ buildDependencies: hooks.filter(`build.snapshot.buildDependencies`, env.isTrue(`CI`) ? { hash: true } : { timestamp: true }),
7
+ module: hooks.filter(`build.snapshot.module`, env.isTrue(`CI`) ? { hash: true } : { timestamp: true }),
8
+ resolve: hooks.filter(`build.snapshot.resolve`, env.isTrue(`CI`) ? { hash: true } : { timestamp: true }),
9
+ resolveBuildDependencies: hooks.filter(`build.snapshot.resolveBuildDependencies`, env.isTrue(`CI`) ? { hash: true } : { timestamp: true }),
5
10
  });
6
- //# sourceMappingURL=snapshot.js.map
@@ -1,3 +1,2 @@
1
1
  import type { Factory } from './index.js';
2
2
  export declare const stats: Factory<`stats`>;
3
- //# sourceMappingURL=stats.d.ts.map
@@ -14,4 +14,3 @@ export const stats = async (app) => app.hooks.filter(`build.stats`, app.isProduc
14
14
  warningsCount: true,
15
15
  }
16
16
  : { preset: `none` });
17
- //# sourceMappingURL=stats.js.map
@@ -1,3 +1,2 @@
1
1
  import type { Factory } from './index.js';
2
2
  export declare const target: Factory<`target`>;
3
- //# sourceMappingURL=target.d.ts.map
@@ -1,4 +1,3 @@
1
1
  export const target = async ({ context, hooks, root }) => hooks.filter(`build.target`, context.manifest?.browserslist
2
2
  ? `browserslist:${root.path(`package.json`)}`
3
3
  : `web`);
4
- //# sourceMappingURL=target.js.map
@@ -17,4 +17,3 @@ export interface Factory<T = Rule> {
17
17
  (props: Props): Promise<T>;
18
18
  }
19
19
  export { items, loaders, register, rules };
20
- //# sourceMappingURL=index.d.ts.map
@@ -3,4 +3,3 @@ import * as loaders from './loaders/loaders.js';
3
3
  import { register } from './register.js';
4
4
  import { rules } from './rules/index.js';
5
5
  export { items, loaders, register, rules };
6
- //# sourceMappingURL=index.js.map
@@ -44,4 +44,3 @@ export declare const xml: Factory<Item>;
44
44
  * Yml loader
45
45
  */
46
46
  export declare const yml: Factory<Item>;
47
- //# sourceMappingURL=items.d.ts.map
@@ -48,7 +48,7 @@ export const minicss = async ({ makeItem }) => makeItem()
48
48
  .setLoader(`minicss`)
49
49
  .setIdent(`minicss`)
50
50
  .setOptions(app => ({
51
- publicPath: app.hooks.filter(`build.output.publicPath`),
51
+ publicPath: app.publicPath(),
52
52
  }));
53
53
  /**
54
54
  * Raw loader
@@ -66,4 +66,3 @@ export const xml = async ({ makeItem }) => makeItem().setLoader(`xml`).setIdent(
66
66
  * Yml loader
67
67
  */
68
68
  export const yml = async ({ makeItem }) => makeItem().setLoader(`yml`).setIdent(`yml`);
69
- //# sourceMappingURL=items.js.map
@@ -9,4 +9,3 @@ export declare const minicss: Factory<Loader>;
9
9
  export declare const style: Factory<Loader>;
10
10
  export declare const xml: Factory<Loader>;
11
11
  export declare const yml: Factory<Loader>;
12
- //# sourceMappingURL=loaders.d.ts.map
@@ -8,4 +8,3 @@ export const minicss = async ({ makeLoader, resolve }) => makeLoader(MiniCss.loa
8
8
  export const style = async ({ makeLoader, resolve }) => makeLoader(await resolve(`@roots/bud-support/style-loader`, import.meta.url));
9
9
  export const xml = async ({ makeLoader, resolve }) => makeLoader(await resolve(`@roots/bud-support/xml-loader`, import.meta.url));
10
10
  export const yml = async ({ makeLoader, resolve }) => makeLoader(await resolve(`@roots/bud-support/yml-loader`, import.meta.url));
11
- //# sourceMappingURL=loaders.js.map
@@ -11,4 +11,3 @@ export interface makeRegister {
11
11
  */
12
12
  export declare function register(bud: Bud): Promise<void>;
13
13
  export declare const makeRegister: makeRegister;
14
- //# sourceMappingURL=register.d.ts.map
@@ -26,4 +26,3 @@ export const makeRegister = ({ build, hooks, isProduction, path, module: { resol
26
26
  path,
27
27
  resolve,
28
28
  }));
29
- //# sourceMappingURL=register.js.map
@@ -1,3 +1,2 @@
1
1
  import type { Factory } from '../index.js';
2
2
  export declare const css: Factory;
3
- //# sourceMappingURL=css.d.ts.map
@@ -2,4 +2,3 @@ export const css = async ({ filter, makeRule }) => makeRule()
2
2
  .setTest(filter(`pattern.css`))
3
3
  .setInclude([({ path }) => path(`@src`)])
4
4
  .setUse([`precss`, `css`]);
5
- //# sourceMappingURL=css.js.map
@@ -1,3 +1,2 @@
1
1
  import type { Factory } from '../index.js';
2
2
  export declare const cssModule: Factory;
3
- //# sourceMappingURL=css.module.d.ts.map
@@ -2,4 +2,3 @@ export const cssModule = async ({ filter, makeRule, path }) => makeRule()
2
2
  .setTest(filter(`pattern.cssModule`))
3
3
  .setInclude([() => path(`@src`)])
4
4
  .setUse([`precss`, `cssModule`]);
5
- //# sourceMappingURL=css.module.js.map
@@ -1,3 +1,2 @@
1
1
  import type { Factory } from '../index.js';
2
2
  export declare const csv: Factory;
3
- //# sourceMappingURL=csv.d.ts.map
@@ -2,4 +2,3 @@ export const csv = async ({ makeRule, path, filter }) => makeRule()
2
2
  .setInclude([path()])
3
3
  .setTest(() => filter(`pattern.csv`))
4
4
  .setUse([`csv`]);
5
- //# sourceMappingURL=csv.js.map
@@ -1,3 +1,2 @@
1
1
  import type { Factory } from '../index.js';
2
2
  export declare const font: Factory;
3
- //# sourceMappingURL=font.d.ts.map
@@ -1,3 +1,2 @@
1
1
  import type { Factory } from '../index.js';
2
2
  export declare const inlineFont: Factory;
3
- //# sourceMappingURL=font.inline.d.ts.map
@@ -3,4 +3,3 @@ export const inlineFont = async ({ filter, makeRule, path }) => makeRule()
3
3
  .setInclude([() => path(`@src`)])
4
4
  .setResourceQuery(/inline/)
5
5
  .setType(`asset/inline`);
6
- //# sourceMappingURL=font.inline.js.map
@@ -2,4 +2,3 @@ export const font = async ({ filter, makeRule, path }) => makeRule()
2
2
  .setType(`asset`)
3
3
  .setTest(filter(`pattern.font`))
4
4
  .setInclude([() => path(`@src`)]);
5
- //# sourceMappingURL=font.js.map
@@ -1,3 +1,2 @@
1
1
  import type { Factory } from '../index.js';
2
2
  export declare const html: Factory;
3
- //# sourceMappingURL=html.d.ts.map
@@ -2,4 +2,3 @@ export const html = async ({ filter, makeRule, path }) => makeRule()
2
2
  .setInclude([() => path()])
3
3
  .setTest(filter(`pattern.html`))
4
4
  .setUse([`html`]);
5
- //# sourceMappingURL=html.js.map
@@ -1,3 +1,2 @@
1
1
  import type { Factory } from '../index.js';
2
2
  export declare const image: Factory;
3
- //# sourceMappingURL=image.d.ts.map
@@ -1,3 +1,2 @@
1
1
  import type { Factory } from '../index.js';
2
2
  export declare const inlineImage: Factory;
3
- //# sourceMappingURL=image.inline.d.ts.map
@@ -3,4 +3,3 @@ export const inlineImage = async ({ filter, makeRule, path }) => makeRule()
3
3
  .setInclude([() => path(`@src`)])
4
4
  .setType(`asset/inline`)
5
5
  .setResourceQuery(/inline/);
6
- //# sourceMappingURL=image.inline.js.map
@@ -2,4 +2,3 @@ export const image = async ({ filter, makeRule, path }) => makeRule()
2
2
  .setTest(filter(`pattern.image`))
3
3
  .setInclude([() => path(`@src`)])
4
4
  .setType(`asset/resource`);
5
- //# sourceMappingURL=image.js.map
@@ -16,4 +16,3 @@ export declare const rules: {
16
16
  css: import("../index.js").Factory<import("../../rule/index.js").Rule>;
17
17
  js: import("../index.js").Factory<import("../../rule/index.js").Rule>;
18
18
  };
19
- //# sourceMappingURL=index.d.ts.map
@@ -32,4 +32,3 @@ export const rules = {
32
32
  css,
33
33
  js,
34
34
  };
35
- //# sourceMappingURL=index.js.map
@@ -1,3 +1,2 @@
1
1
  import type { Factory } from '../index.js';
2
2
  export declare const js: Factory;
3
- //# sourceMappingURL=js.d.ts.map
@@ -1,5 +1,6 @@
1
1
  export const js = async ({ filter, makeRule, path }) => makeRule()
2
2
  .setTest(filter(`pattern.js`))
3
3
  .setInclude([() => path(`@src`)])
4
- .setUse([]);
5
- //# sourceMappingURL=js.js.map
4
+ .setResolve({
5
+ fullySpecified: false,
6
+ });
@@ -1,3 +1,2 @@
1
1
  import type { Factory } from '../index.js';
2
2
  export declare const json: Factory;
3
- //# sourceMappingURL=json.d.ts.map