@roots/bud-build 6.13.0 → 6.14.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 (68) hide show
  1. package/lib/config/experiments.js +5 -1
  2. package/lib/config/index.d.ts +1 -1
  3. package/lib/config/infrastructureLogging.js +7 -7
  4. package/lib/config/module.js +1 -1
  5. package/lib/config/optimization.js +2 -2
  6. package/lib/config/output/index.js +8 -3
  7. package/lib/config/parallelism.js +8 -1
  8. package/lib/config/resolve.js +2 -1
  9. package/lib/config/resolveLoader.js +10 -2
  10. package/lib/config/snapshot.js +1 -1
  11. package/lib/config/stats.js +4 -1
  12. package/lib/handlers/index.d.ts +1 -1
  13. package/lib/handlers/items/items.d.ts +1 -5
  14. package/lib/handlers/items/items.js +1 -5
  15. package/lib/handlers/loaders/loaders.d.ts +0 -1
  16. package/lib/handlers/loaders/loaders.js +0 -1
  17. package/lib/handlers/register.js +2 -2
  18. package/lib/handlers/rules/csv.js +1 -1
  19. package/lib/handlers/rules/index.d.ts +9 -10
  20. package/lib/handlers/rules/index.js +9 -11
  21. package/lib/index.d.ts +1 -1
  22. package/lib/index.js +1 -1
  23. package/lib/item/index.d.ts +11 -11
  24. package/lib/item/index.js +33 -33
  25. package/lib/rule/index.d.ts +54 -54
  26. package/lib/rule/index.js +111 -110
  27. package/lib/service.d.ts +27 -30
  28. package/lib/service.js +61 -72
  29. package/lib/shared/base.d.ts +6 -6
  30. package/lib/shared/base.js +15 -15
  31. package/lib/types.d.ts +19 -18
  32. package/lib/types.js +0 -2
  33. package/package.json +10 -10
  34. package/src/config/experiments.ts +8 -1
  35. package/src/config/index.test.ts +3 -3
  36. package/src/config/index.ts +1 -1
  37. package/src/config/infrastructureLogging.ts +7 -7
  38. package/src/config/module.ts +2 -2
  39. package/src/config/optimization.ts +6 -6
  40. package/src/config/output/index.ts +10 -4
  41. package/src/config/parallelism.ts +12 -2
  42. package/src/config/resolve.ts +13 -4
  43. package/src/config/resolveLoader.ts +19 -2
  44. package/src/config/snapshot.ts +4 -4
  45. package/src/config/stats.ts +4 -1
  46. package/src/handlers/index.ts +2 -1
  47. package/src/handlers/items/items.ts +2 -7
  48. package/src/handlers/loaders/loaders.ts +1 -5
  49. package/src/handlers/register.ts +3 -2
  50. package/src/handlers/rules/csv.test.ts +1 -1
  51. package/src/handlers/rules/csv.ts +1 -1
  52. package/src/handlers/rules/index.ts +9 -11
  53. package/src/handlers/rules/svg.inline.test.ts +1 -1
  54. package/src/handlers/rules/toml.test.ts +1 -1
  55. package/src/index.ts +1 -2
  56. package/src/item/index.ts +31 -29
  57. package/src/rule/index.test.ts +1 -1
  58. package/src/rule/index.ts +95 -94
  59. package/src/service.ts +74 -70
  60. package/src/shared/base.ts +12 -11
  61. package/src/types.ts +20 -20
  62. package/lib/config/output/chunkFilename.d.ts +0 -7
  63. package/lib/config/output/chunkFilename.js +0 -3
  64. package/lib/handlers/rules/xml.d.ts +0 -2
  65. package/lib/handlers/rules/xml.js +0 -4
  66. package/src/config/output/chunkFilename.ts +0 -18
  67. package/src/handlers/rules/xml.test.ts +0 -30
  68. package/src/handlers/rules/xml.ts +0 -7
@@ -1,3 +1,7 @@
1
- export const experiments = async ({ hooks }) => hooks.filter(`build.experiments`, {
1
+ export const experiments = async ({ hooks, isDevelopment, }) => hooks.filter(`build.experiments`, {
2
2
  backCompat: false,
3
+ lazyCompilation: isDevelopment
4
+ ? { entries: false, imports: true }
5
+ : false,
6
+ topLevelAwait: true,
3
7
  });
@@ -1,5 +1,5 @@
1
1
  import type { Bud } from '@roots/bud-framework';
2
- import type { Configuration } from '@roots/bud-support/webpack';
2
+ import type { Configuration } from '@roots/bud-framework/config';
3
3
  import { bail } from './bail.js';
4
4
  import { cache } from './cache.js';
5
5
  import { context } from './context.js';
@@ -1,19 +1,19 @@
1
- import logger from '@roots/bud-support/utilities/logger';
1
+ import logger from '@roots/bud-support/logger';
2
2
  export const infrastructureLogging = async (bud) => bud.hooks.filter(`build.infrastructureLogging`, {
3
3
  console: bud.hooks.filter(`build.infrastructureLogging.console`, {
4
4
  ...console,
5
- log: (...args) => {
6
- logger.scope(`webpack`).log(...args);
7
- },
8
- warn: (...args) => {
9
- logger.scope(`webpack`).info(...args);
10
- },
11
5
  error: (...args) => {
12
6
  logger.scope(`webpack`).error(...args);
13
7
  },
14
8
  info: (...args) => {
15
9
  logger.scope(`webpack`).info(...args);
16
10
  },
11
+ log: (...args) => {
12
+ logger.scope(`webpack`).log(...args);
13
+ },
14
+ warn: (...args) => {
15
+ logger.scope(`webpack`).info(...args);
16
+ },
17
17
  }),
18
18
  level: bud.hooks.filter(`build.infrastructureLogging.level`, `log`),
19
19
  });
@@ -6,9 +6,9 @@ export const module = async ({ build: { rules }, hooks: { filter }, path, }) =>
6
6
  const getRules = ({ filter, path, rules }) => [
7
7
  ...filter(`build.module.rules.before`, [
8
8
  {
9
- test: filter(`pattern.js`),
10
9
  include: [path(`@src`)],
11
10
  parser: { requireEnsure: false },
11
+ test: filter(`pattern.js`),
12
12
  },
13
13
  ]),
14
14
  {
@@ -6,15 +6,15 @@ export const optimization = async ({ hooks: { filter }, isDevelopment, isProduct
6
6
  minimizer: filter(`build.optimization.minimizer`, []),
7
7
  moduleIds: filter(`build.optimization.moduleIds`, `named`),
8
8
  nodeEnv: filter(`build.optimization.nodeEnv`, mode),
9
- removeEmptyChunks: filter(`build.optimization.removeEmptyChunks`, isProduction),
9
+ providedExports: filter(`build.optimization.providedExports`, isProduction),
10
10
  /**
11
11
  * Will be new default in webpack 6
12
12
  * @see {@link https://webpack.js.org/configuration/optimization/#optimizationremoveavailablemodules}
13
13
  */
14
14
  removeAvailableModules: filter(`build.optimization.removeAvailableModules`, false),
15
+ removeEmptyChunks: filter(`build.optimization.removeEmptyChunks`, isProduction),
15
16
  runtimeChunk: filter(`build.optimization.runtimeChunk`, `single`),
16
17
  sideEffects: filter(`build.optimization.sideEffects`, isProduction),
17
18
  splitChunks: filter(`build.optimization.splitChunks`, false),
18
- providedExports: filter(`build.optimization.providedExports`, isProduction),
19
19
  usedExports: filter(`build.optimization.usedExports`, isProduction),
20
20
  });
@@ -1,17 +1,22 @@
1
1
  import { isMjs } from '../../helpers/isMjs.js';
2
2
  import { assetModuleFilename } from './assetModuleFilename.js';
3
- import { chunkFilename } from './chunkFilename.js';
4
3
  import { filename } from './filename.js';
5
4
  export const output = async ({ hooks: { filter }, isProduction, path, relPath, }) => filter(`build.output`, {
6
5
  assetModuleFilename: assetModuleFilename({ filter, relPath }),
7
- chunkFilename: chunkFilename({ filter, relPath }),
6
+ /**
7
+ * This should be kept undefined as documented here:
8
+ * {@see https://webpack.js.org/plugins/split-chunks-plugin/#splitchunkscachegroupscachegroupfilename}
9
+ */
10
+ // chunkFilename: chunkFilename({filter, relPath}),
8
11
  clean: filter(`build.output.clean`, isProduction),
9
12
  environment: filter(`build.output.environment`, undefined),
10
13
  filename: filename({ filter, relPath }),
14
+ hashFunction: filter(`build.output.hashFunction`, `xxhash64`),
15
+ iife: filter(`build.output.iife`, undefined),
11
16
  module: filter(`build.output.module`, false),
12
17
  path: filter(`build.output.path`, path(`@dist`)),
13
18
  pathinfo: filter(`build.output.pathinfo`, false),
14
19
  publicPath: filter(`build.output.publicPath`, `auto`),
15
- scriptType: filter(`build.output.scriptType`, isMjs(filter) ? `module` : false),
20
+ scriptType: filter(`build.output.scriptType`, isMjs(filter) ? `module` : `text/javascript`),
16
21
  uniqueName: filter(`build.output.uniqueName`, `@roots/bud`),
17
22
  });
@@ -1,2 +1,9 @@
1
1
  import { cpus } from 'node:os';
2
- export const parallelism = async ({ hooks }) => hooks.filter(`build.parallelism`, 10 * Math.max(cpus().length - 1, 1));
2
+ export const parallelism = async ({ hooks, root, }) => {
3
+ const factor = 10;
4
+ const procs = Math.min(cpus().length - 1, 1);
5
+ const comps = root.hasChildren
6
+ ? Math.min(Object.keys(root.children).length)
7
+ : 1;
8
+ return hooks.filter(`build.parallelism`, (procs * factor) / comps);
9
+ };
@@ -1,3 +1,4 @@
1
+ import isString from '@roots/bud-support/lodash/isString';
1
2
  export const resolve = async (bud) => {
2
3
  return await bud.hooks.filterAsync(`build.resolve`, {
3
4
  alias: {
@@ -12,7 +13,7 @@ export const resolve = async (bud) => {
12
13
  modules: await bud.hooks.filterAsync(`build.resolve.modules`, [
13
14
  bud.hooks.filter(`location.@src`),
14
15
  bud.hooks.filter(`location.@modules`),
15
- ]),
16
+ ].filter(v => isString(v) && v.length > 0)),
16
17
  /**
17
18
  * Leave `undefined` to use webpack default (true in dev, false in production)
18
19
  */
@@ -1,3 +1,11 @@
1
- export const resolveLoader = async ({ hooks }) => hooks.filter(`build.resolveLoader`, {
2
- alias: hooks.filter(`build.resolveLoader.alias`, {}),
1
+ export const resolveLoader = async ({ hooks, module, }) => hooks.filter(`build.resolveLoader`, {
2
+ alias: hooks.filter(`build.resolveLoader.alias`, {
3
+ 'css-loader': await module.resolve(`@roots/bud-support/css-loader`),
4
+ 'file-loader': await module.resolve(`@roots/bud-support/file-loader`),
5
+ 'html-loader': await module.resolve(`@roots/bud-support/html-loader`),
6
+ json5: await module.resolve(`@roots/bud-support/json5`),
7
+ 'mini-svg-data-uri': await module.resolve(`mini-svg-data-uri`),
8
+ 'style-loader': await module.resolve(`@roots/bud-support/style-loader`),
9
+ toml: await module.resolve(`@roots/bud-support/toml`),
10
+ }),
3
11
  });
@@ -1,9 +1,9 @@
1
1
  export const snapshot = async ({ env, hooks, path }) => hooks.filter(`build.snapshot`, {
2
+ buildDependencies: hooks.filter(`build.snapshot.buildDependencies`, env.isTrue(`CI`) ? { hash: true } : { timestamp: true }),
2
3
  immutablePaths: hooks.filter(`build.snapshot.immutablePaths`, []),
3
4
  managedPaths: hooks.filter(`build.snapshot.managedPaths`, [
4
5
  ...new Set([path(`@modules`)]),
5
6
  ]),
6
- buildDependencies: hooks.filter(`build.snapshot.buildDependencies`, env.isTrue(`CI`) ? { hash: true } : { timestamp: true }),
7
7
  module: hooks.filter(`build.snapshot.module`, env.isTrue(`CI`) ? { hash: true } : { timestamp: true }),
8
8
  resolve: hooks.filter(`build.snapshot.resolve`, env.isTrue(`CI`) ? { hash: true } : { timestamp: true }),
9
9
  resolveBuildDependencies: hooks.filter(`build.snapshot.resolveBuildDependencies`, env.isTrue(`CI`) ? { hash: true } : { timestamp: true }),
@@ -2,13 +2,16 @@ export const stats = async (app) => app.hooks.filter(`build.stats`, app.isProduc
2
2
  ? {
3
3
  all: false,
4
4
  assets: true,
5
+ assetsSort: `size`,
6
+ builtAt: false,
5
7
  children: false,
8
+ chunks: false,
6
9
  entrypoints: true,
7
10
  errors: true,
8
11
  errorsCount: true,
9
12
  hash: true,
10
- outputPath: true,
11
13
  modules: true,
14
+ outputPath: true,
12
15
  timings: true,
13
16
  warnings: true,
14
17
  warningsCount: true,
@@ -6,10 +6,10 @@ import { register } from './register.js';
6
6
  import { rules } from './rules/index.js';
7
7
  export interface Props {
8
8
  filter: Bud[`hooks`][`filter`];
9
+ isProduction: Bud[`isProduction`];
9
10
  makeItem: Bud[`build`][`makeItem`];
10
11
  makeLoader: Bud[`build`][`makeLoader`];
11
12
  makeRule: Bud[`build`][`makeRule`];
12
- isProduction: Bud[`isProduction`];
13
13
  path: Bud[`path`];
14
14
  resolve: Bud[`module`][`resolve`];
15
15
  }
@@ -33,13 +33,9 @@ export declare const minicss: Factory<Item>;
33
33
  */
34
34
  export declare const raw: Factory<Item>;
35
35
  /**
36
- * File loader
36
+ * file-loader
37
37
  */
38
38
  export declare const file: Factory<Item>;
39
- /**
40
- * Xml loader
41
- */
42
- export declare const xml: Factory<Item>;
43
39
  /**
44
40
  * Yml loader
45
41
  */
@@ -55,13 +55,9 @@ export const minicss = async ({ makeItem }) => makeItem()
55
55
  */
56
56
  export const raw = async ({ makeItem }) => makeItem().setLoader(`raw`).setIdent(`raw`);
57
57
  /**
58
- * File loader
58
+ * file-loader
59
59
  */
60
60
  export const file = async ({ makeItem }) => makeItem().setLoader(`file`).setIdent(`file`);
61
- /**
62
- * Xml loader
63
- */
64
- export const xml = async ({ makeItem }) => makeItem().setLoader(`xml`).setIdent(`xml`);
65
61
  /**
66
62
  * Yml loader
67
63
  */
@@ -7,5 +7,4 @@ export declare const html: Factory<Loader>;
7
7
  export declare const remark: Factory<Loader>;
8
8
  export declare const minicss: Factory<Loader>;
9
9
  export declare const style: Factory<Loader>;
10
- export declare const xml: Factory<Loader>;
11
10
  export declare const yml: Factory<Loader>;
@@ -6,5 +6,4 @@ export const html = async ({ makeLoader, resolve }) => makeLoader(await resolve(
6
6
  export const remark = async ({ makeLoader, resolve }) => makeLoader(await resolve(`@roots/bud-support/remark-loader`, import.meta.url));
7
7
  export const minicss = async ({ makeLoader, resolve }) => makeLoader(MiniCss.loader);
8
8
  export const style = async ({ makeLoader, resolve }) => makeLoader(await resolve(`@roots/bud-support/style-loader`, import.meta.url));
9
- export const xml = async ({ makeLoader, resolve }) => makeLoader(await resolve(`@roots/bud-support/xml-loader`, import.meta.url));
10
9
  export const yml = async ({ makeLoader, resolve }) => makeLoader(await resolve(`@roots/bud-support/yml-loader`, import.meta.url));
@@ -17,12 +17,12 @@ export async function register(bud) {
17
17
  : bud.build.items.style;
18
18
  Object.entries(rules).map(makeRegister(bud, bud.build.setRule));
19
19
  }
20
- export const makeRegister = ({ build, hooks, isProduction, path, module: { resolve } }, setRule) => async ([key, factory]) => setRule(key, await factory({
20
+ export const makeRegister = ({ build, hooks, isProduction, module: { resolve }, path }, setRule) => async ([key, factory]) => setRule(key, await factory({
21
21
  filter: hooks.filter,
22
+ isProduction,
22
23
  makeItem: build.makeItem,
23
24
  makeLoader: build.makeLoader,
24
25
  makeRule: build.makeRule,
25
- isProduction,
26
26
  path,
27
27
  resolve,
28
28
  }));
@@ -1,4 +1,4 @@
1
- export const csv = async ({ makeRule, path, filter }) => makeRule()
1
+ export const csv = async ({ filter, makeRule, path }) => makeRule()
2
2
  .setInclude([path()])
3
3
  .setTest(() => filter(`pattern.csv`))
4
4
  .setUse([`csv`]);
@@ -1,18 +1,17 @@
1
1
  export declare const rules: {
2
- toml: import("../index.js").Factory<import("../../rule/index.js").Rule>;
3
- xml: import("../index.js").Factory<import("../../rule/index.js").Rule>;
2
+ css: import("../index.js").Factory<import("../../rule/index.js").Rule>;
3
+ cssModule: import("../index.js").Factory<import("../../rule/index.js").Rule>;
4
4
  csv: import("../index.js").Factory<import("../../rule/index.js").Rule>;
5
- yml: import("../index.js").Factory<import("../../rule/index.js").Rule>;
6
- html: import("../index.js").Factory<import("../../rule/index.js").Rule>;
7
- json: import("../index.js").Factory<import("../../rule/index.js").Rule>;
8
5
  font: import("../index.js").Factory<import("../../rule/index.js").Rule>;
9
- svg: import("../index.js").Factory<import("../../rule/index.js").Rule>;
10
- webp: import("../index.js").Factory<import("../../rule/index.js").Rule>;
6
+ html: import("../index.js").Factory<import("../../rule/index.js").Rule>;
11
7
  image: import("../index.js").Factory<import("../../rule/index.js").Rule>;
12
8
  inlineFont: import("../index.js").Factory<import("../../rule/index.js").Rule>;
13
- inlineSvg: import("../index.js").Factory<import("../../rule/index.js").Rule>;
14
9
  inlineImage: import("../index.js").Factory<import("../../rule/index.js").Rule>;
15
- cssModule: import("../index.js").Factory<import("../../rule/index.js").Rule>;
16
- css: import("../index.js").Factory<import("../../rule/index.js").Rule>;
10
+ inlineSvg: import("../index.js").Factory<import("../../rule/index.js").Rule>;
17
11
  js: import("../index.js").Factory<import("../../rule/index.js").Rule>;
12
+ json: import("../index.js").Factory<import("../../rule/index.js").Rule>;
13
+ svg: import("../index.js").Factory<import("../../rule/index.js").Rule>;
14
+ toml: import("../index.js").Factory<import("../../rule/index.js").Rule>;
15
+ webp: import("../index.js").Factory<import("../../rule/index.js").Rule>;
16
+ yml: import("../index.js").Factory<import("../../rule/index.js").Rule>;
18
17
  };
@@ -12,23 +12,21 @@ import { inlineSvg } from './svg.inline.js';
12
12
  import { svg } from './svg.js';
13
13
  import { toml } from './toml.js';
14
14
  import { webp } from './webp.js';
15
- import { xml } from './xml.js';
16
15
  import { yml } from './yml.js';
17
16
  export const rules = {
18
- toml,
19
- xml,
17
+ css,
18
+ cssModule,
20
19
  csv,
21
- yml,
22
- html,
23
- json,
24
20
  font,
25
- svg,
26
- webp,
21
+ html,
27
22
  image,
28
23
  inlineFont,
29
- inlineSvg,
30
24
  inlineImage,
31
- cssModule,
32
- css,
25
+ inlineSvg,
33
26
  js,
27
+ json,
28
+ svg,
29
+ toml,
30
+ webp,
31
+ yml,
34
32
  };
package/lib/index.d.ts CHANGED
@@ -4,10 +4,10 @@
4
4
  * @see https://bud.js.org
5
5
  * @see https://github.com/roots/bud
6
6
  */
7
- import './types.js';
8
7
  import { Item } from './item/index.js';
9
8
  import { Loader } from './loader/index.js';
10
9
  import { Rule } from './rule/index.js';
11
10
  import { Build } from './service.js';
11
+ import './types.js';
12
12
  export default Build;
13
13
  export { Item, Loader, Rule };
package/lib/index.js CHANGED
@@ -6,10 +6,10 @@
6
6
  * @see https://bud.js.org
7
7
  * @see https://github.com/roots/bud
8
8
  */
9
- import './types.js';
10
9
  import { Item } from './item/index.js';
11
10
  import { Loader } from './loader/index.js';
12
11
  import { Rule } from './rule/index.js';
13
12
  import { Build } from './service.js';
13
+ import './types.js';
14
14
  export default Build;
15
15
  export { Item, Loader, Rule };
@@ -15,7 +15,7 @@ declare class Item extends Base implements Build.Item {
15
15
  /**
16
16
  * Loader
17
17
  */
18
- loader: Loader | `${keyof Loaders & string}`;
18
+ loader: `${keyof Loaders & string}` | Loader;
19
19
  /**
20
20
  * Loader options
21
21
  */
@@ -25,31 +25,31 @@ declare class Item extends Base implements Build.Item {
25
25
  */
26
26
  constructor(_app: () => Bud, constructorParams?: {
27
27
  ident?: string;
28
- loader?: Loader | `${keyof Loaders & string}`;
28
+ loader?: `${keyof Loaders & string}` | Loader;
29
29
  options?: Item['options'];
30
30
  });
31
31
  getIdent(): Build.Item['ident'];
32
- setIdent(ident: Build.Item['ident']): this;
33
32
  /**
34
33
  * Get rule set item loader
35
34
  */
36
35
  getLoader(): Loader;
37
- /**
38
- * Set rule set item loader
39
- */
40
- setLoader(loader: Loader | `${keyof Loaders & string}`): this;
41
36
  /**
42
37
  * Get rule set item options
43
38
  */
44
39
  getOptions(): Item['options'];
45
- /**
46
- * Set rule set item options
47
- */
48
- setOptions(options: Item['options']): this;
49
40
  /**
50
41
  * Merge rule set item options
51
42
  */
52
43
  mergeOptions(options: Build.Item.Options): this;
44
+ setIdent(ident: Build.Item['ident']): this;
45
+ /**
46
+ * Set rule set item loader
47
+ */
48
+ setLoader(loader: `${keyof Loaders & string}` | Loader): this;
49
+ /**
50
+ * Set rule set item options
51
+ */
52
+ setOptions(options: Item['options']): this;
53
53
  /**
54
54
  * Produce rule set item object for Webpack
55
55
  */
package/lib/item/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { __decorate, __metadata } from "tslib";
2
+ import { basename } from 'path';
2
3
  import { bind } from '@roots/bud-support/decorators/bind';
3
4
  import isString from '@roots/bud-support/lodash/isString';
4
- import { basename } from 'path';
5
5
  import { Loader } from '../loader/index.js';
6
6
  import Base from '../shared/base.js';
7
7
  /**
@@ -40,10 +40,6 @@ class Item extends Base {
40
40
  getIdent() {
41
41
  return this.ident;
42
42
  }
43
- setIdent(ident) {
44
- this.ident = ident;
45
- return this;
46
- }
47
43
  /**
48
44
  * Get rule set item loader
49
45
  */
@@ -52,28 +48,12 @@ class Item extends Base {
52
48
  ? this.loader
53
49
  : this.app.build.loaders[this.loader];
54
50
  }
55
- /**
56
- * Set rule set item loader
57
- */
58
- setLoader(loader) {
59
- this.loader = loader;
60
- if (!this.ident)
61
- this.setIdent(basename(isString(loader) ? loader : loader.getSrc()));
62
- return this;
63
- }
64
51
  /**
65
52
  * Get rule set item options
66
53
  */
67
54
  getOptions() {
68
55
  return this.unwrap(this.options);
69
56
  }
70
- /**
71
- * Set rule set item options
72
- */
73
- setOptions(options) {
74
- this.options = options;
75
- return this;
76
- }
77
57
  /**
78
58
  * Merge rule set item options
79
59
  */
@@ -84,6 +64,26 @@ class Item extends Base {
84
64
  });
85
65
  return this;
86
66
  }
67
+ setIdent(ident) {
68
+ this.ident = ident;
69
+ return this;
70
+ }
71
+ /**
72
+ * Set rule set item loader
73
+ */
74
+ setLoader(loader) {
75
+ this.loader = loader;
76
+ if (!this.ident)
77
+ this.setIdent(basename(isString(loader) ? loader : loader.getSrc()));
78
+ return this;
79
+ }
80
+ /**
81
+ * Set rule set item options
82
+ */
83
+ setOptions(options) {
84
+ this.options = options;
85
+ return this;
86
+ }
87
87
  /**
88
88
  * Produce rule set item object for Webpack
89
89
  */
@@ -115,39 +115,39 @@ __decorate([
115
115
  __decorate([
116
116
  bind,
117
117
  __metadata("design:type", Function),
118
- __metadata("design:paramtypes", [Object]),
119
- __metadata("design:returntype", Object)
120
- ], Item.prototype, "setIdent", null);
118
+ __metadata("design:paramtypes", []),
119
+ __metadata("design:returntype", Loader)
120
+ ], Item.prototype, "getLoader", null);
121
121
  __decorate([
122
122
  bind,
123
123
  __metadata("design:type", Function),
124
124
  __metadata("design:paramtypes", []),
125
- __metadata("design:returntype", Loader)
126
- ], Item.prototype, "getLoader", null);
125
+ __metadata("design:returntype", Object)
126
+ ], Item.prototype, "getOptions", null);
127
127
  __decorate([
128
128
  bind,
129
129
  __metadata("design:type", Function),
130
130
  __metadata("design:paramtypes", [Object]),
131
131
  __metadata("design:returntype", Object)
132
- ], Item.prototype, "setLoader", null);
132
+ ], Item.prototype, "mergeOptions", null);
133
133
  __decorate([
134
134
  bind,
135
135
  __metadata("design:type", Function),
136
- __metadata("design:paramtypes", []),
136
+ __metadata("design:paramtypes", [Object]),
137
137
  __metadata("design:returntype", Object)
138
- ], Item.prototype, "getOptions", null);
138
+ ], Item.prototype, "setIdent", null);
139
139
  __decorate([
140
140
  bind,
141
141
  __metadata("design:type", Function),
142
142
  __metadata("design:paramtypes", [Object]),
143
- __metadata("design:returntype", void 0)
144
- ], Item.prototype, "setOptions", null);
143
+ __metadata("design:returntype", Object)
144
+ ], Item.prototype, "setLoader", null);
145
145
  __decorate([
146
146
  bind,
147
147
  __metadata("design:type", Function),
148
148
  __metadata("design:paramtypes", [Object]),
149
- __metadata("design:returntype", Object)
150
- ], Item.prototype, "mergeOptions", null);
149
+ __metadata("design:returntype", void 0)
150
+ ], Item.prototype, "setOptions", null);
151
151
  __decorate([
152
152
  bind,
153
153
  __metadata("design:type", Function),