@roots/bud-build 6.14.2 → 6.15.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.
- package/lib/config/bail.d.ts +1 -1
- package/lib/config/cache.d.ts +1 -1
- package/lib/config/context.d.ts +1 -1
- package/lib/config/dependencies.d.ts +1 -1
- package/lib/config/devtool.d.ts +1 -1
- package/lib/config/entry.d.ts +1 -1
- package/lib/config/experiments.d.ts +1 -1
- package/lib/config/experiments.js +1 -0
- package/lib/config/externals.d.ts +1 -1
- package/lib/config/externalsType.d.ts +1 -1
- package/lib/config/index.d.ts +28 -29
- package/lib/config/index.js +27 -28
- package/lib/config/infrastructureLogging.d.ts +1 -1
- package/lib/config/infrastructureLogging.js +4 -4
- package/lib/config/loader.d.ts +1 -1
- package/lib/config/mode.d.ts +1 -1
- package/lib/config/module.d.ts +1 -1
- package/lib/config/name.d.ts +1 -1
- package/lib/config/node.d.ts +1 -1
- package/lib/config/optimization.d.ts +1 -1
- package/lib/config/optimization.js +1 -1
- package/lib/config/output/assetModuleFilename.js +1 -1
- package/lib/config/output/filename.js +1 -1
- package/lib/config/output/index.d.ts +1 -1
- package/lib/config/output/index.js +7 -2
- package/lib/config/parallelism.d.ts +1 -1
- package/lib/config/parallelism.js +8 -7
- package/lib/config/performance.d.ts +1 -1
- package/lib/config/plugins.d.ts +1 -1
- package/lib/config/plugins.js +4 -1
- package/lib/config/profile.d.ts +1 -1
- package/lib/config/recordsPath.d.ts +1 -1
- package/lib/config/resolve.d.ts +1 -1
- package/lib/config/resolve.js +1 -1
- package/lib/config/resolveLoader.d.ts +1 -1
- package/lib/config/resolveLoader.js +0 -3
- package/lib/config/snapshot.d.ts +1 -1
- package/lib/config/stats.d.ts +1 -1
- package/lib/config/stats.js +1 -19
- package/lib/config/target.d.ts +1 -1
- package/lib/helpers/isMjs.d.ts +2 -1
- package/lib/helpers/isMjs.js +2 -1
- package/lib/{shared/base.d.ts → helpers/registrable.d.ts} +2 -1
- package/lib/{shared/base.js → helpers/registrable.js} +7 -13
- package/lib/helpers/script-extension.d.ts +3 -0
- package/lib/helpers/script-extension.js +5 -0
- package/lib/index.d.ts +53 -7
- package/lib/index.js +5 -7
- package/lib/item/index.d.ts +4 -4
- package/lib/item/index.js +14 -38
- package/lib/{handlers/items/items.d.ts → items/index.d.ts} +1 -1
- package/lib/loader/index.d.ts +4 -4
- package/lib/loader/index.js +4 -4
- package/lib/{handlers/loaders/loaders.d.ts → loaders/index.d.ts} +1 -1
- package/lib/registry/index.d.ts +36 -0
- package/lib/{handlers/register.js → registry/index.js} +9 -5
- package/lib/rule/index.d.ts +3 -3
- package/lib/rule/index.js +22 -76
- package/lib/rules/css.d.ts +3 -0
- package/lib/{handlers/rules → rules}/css.js +2 -1
- package/lib/rules/css.module.d.ts +3 -0
- package/lib/{handlers/rules → rules}/css.module.js +2 -1
- package/lib/rules/csv.d.ts +3 -0
- package/lib/{handlers/rules → rules}/csv.js +2 -1
- package/lib/rules/font.d.ts +3 -0
- package/lib/rules/font.inline.d.ts +3 -0
- package/lib/{handlers/rules → rules}/font.inline.js +2 -1
- package/lib/{handlers/rules → rules}/font.js +2 -1
- package/lib/rules/html.d.ts +3 -0
- package/lib/{handlers/rules → rules}/html.js +2 -1
- package/lib/rules/image.d.ts +3 -0
- package/lib/rules/image.inline.d.ts +3 -0
- package/lib/{handlers/rules → rules}/image.inline.js +2 -1
- package/lib/rules/image.js +8 -0
- package/lib/rules/index.d.ts +15 -0
- package/lib/rules/index.js +15 -0
- package/lib/rules/js.d.ts +3 -0
- package/lib/{handlers/rules → rules}/js.js +2 -1
- package/lib/rules/json.d.ts +3 -0
- package/lib/{handlers/rules → rules}/json.js +2 -1
- package/lib/rules/svg.d.ts +3 -0
- package/lib/rules/svg.inline.d.ts +5 -0
- package/lib/{handlers/rules → rules}/svg.inline.js +3 -2
- package/lib/{handlers/rules → rules}/svg.js +2 -1
- package/lib/rules/toml.d.ts +3 -0
- package/lib/{handlers/rules → rules}/toml.js +2 -1
- package/lib/rules/webp.d.ts +3 -0
- package/lib/{handlers/rules → rules}/webp.js +2 -1
- package/lib/rules/yml.d.ts +3 -0
- package/lib/{handlers/rules → rules}/yml.js +2 -1
- package/lib/{service.d.ts → service/index.d.ts} +27 -24
- package/lib/{service.js → service/index.js} +45 -70
- package/package.json +121 -37
- package/src/config/bail.ts +1 -1
- package/src/config/cache.ts +1 -1
- package/src/config/context.ts +1 -1
- package/src/config/dependencies.ts +2 -2
- package/src/config/devtool.ts +1 -1
- package/src/config/entry.ts +1 -1
- package/src/config/experiments.ts +2 -1
- package/src/config/externals.ts +1 -1
- package/src/config/externalsType.ts +1 -1
- package/src/config/index.ts +28 -58
- package/src/config/infrastructureLogging.ts +6 -6
- package/src/config/loader.ts +1 -1
- package/src/config/mode.ts +1 -1
- package/src/config/module.ts +1 -2
- package/src/config/name.ts +1 -1
- package/src/config/node.ts +1 -1
- package/src/config/optimization.ts +2 -2
- package/src/config/output/assetModuleFilename.ts +1 -1
- package/src/config/output/filename.ts +1 -1
- package/src/config/output/index.ts +8 -6
- package/src/config/parallelism.ts +11 -8
- package/src/config/performance.ts +1 -1
- package/src/config/plugins.ts +5 -3
- package/src/config/profile.ts +1 -1
- package/src/config/recordsPath.ts +1 -1
- package/src/config/resolve.ts +3 -3
- package/src/config/resolveLoader.ts +1 -4
- package/src/config/snapshot.ts +1 -1
- package/src/config/stats.ts +2 -23
- package/src/config/target.ts +1 -1
- package/src/helpers/isMjs.ts +3 -1
- package/src/{shared/base.ts → helpers/registrable.ts} +3 -1
- package/src/helpers/{scriptExtension.ts → script-extension.ts} +4 -2
- package/src/index.ts +56 -7
- package/src/item/index.ts +5 -6
- package/src/{handlers/items/items.ts → items/index.ts} +1 -2
- package/src/loader/index.ts +6 -5
- package/src/{handlers/loaders/loaders.ts → loaders/index.ts} +1 -2
- package/src/{handlers/register.ts → registry/index.ts} +36 -13
- package/src/rule/index.ts +3 -4
- package/src/rules/css.module.ts +9 -0
- package/src/rules/css.ts +9 -0
- package/src/rules/csv.ts +9 -0
- package/src/rules/font.inline.ts +10 -0
- package/src/rules/font.ts +9 -0
- package/src/rules/html.ts +9 -0
- package/src/rules/image.inline.ts +10 -0
- package/src/rules/image.ts +12 -0
- package/src/rules/index.ts +15 -0
- package/src/{handlers/rules → rules}/js.ts +4 -2
- package/src/{handlers/rules → rules}/json.ts +5 -3
- package/src/{handlers/rules → rules}/svg.inline.ts +6 -4
- package/src/rules/svg.ts +9 -0
- package/src/{handlers/rules → rules}/toml.ts +5 -3
- package/src/rules/webp.ts +9 -0
- package/src/rules/yml.ts +9 -0
- package/src/{service.ts → service/index.ts} +43 -36
- package/lib/handlers/index.d.ts +0 -19
- package/lib/handlers/index.js +0 -5
- package/lib/handlers/register.d.ts +0 -13
- package/lib/handlers/rules/css.d.ts +0 -2
- package/lib/handlers/rules/css.module.d.ts +0 -2
- package/lib/handlers/rules/csv.d.ts +0 -2
- package/lib/handlers/rules/font.d.ts +0 -2
- package/lib/handlers/rules/font.inline.d.ts +0 -2
- package/lib/handlers/rules/html.d.ts +0 -2
- package/lib/handlers/rules/image.d.ts +0 -2
- package/lib/handlers/rules/image.inline.d.ts +0 -2
- package/lib/handlers/rules/image.js +0 -4
- package/lib/handlers/rules/index.d.ts +0 -17
- package/lib/handlers/rules/index.js +0 -32
- package/lib/handlers/rules/js.d.ts +0 -2
- package/lib/handlers/rules/json.d.ts +0 -2
- package/lib/handlers/rules/svg.d.ts +0 -2
- package/lib/handlers/rules/svg.inline.d.ts +0 -4
- package/lib/handlers/rules/toml.d.ts +0 -2
- package/lib/handlers/rules/webp.d.ts +0 -2
- package/lib/handlers/rules/yml.d.ts +0 -2
- package/lib/helpers/scriptExtension.d.ts +0 -2
- package/lib/helpers/scriptExtension.js +0 -4
- package/lib/types.d.ts +0 -52
- package/lib/types.js +0 -1
- package/src/config/index.test.ts +0 -125
- package/src/handlers/index.ts +0 -24
- package/src/handlers/rules/css.module.ts +0 -7
- package/src/handlers/rules/css.ts +0 -7
- package/src/handlers/rules/csv.test.ts +0 -31
- package/src/handlers/rules/csv.ts +0 -7
- package/src/handlers/rules/font.inline.ts +0 -8
- package/src/handlers/rules/font.ts +0 -7
- package/src/handlers/rules/html.ts +0 -7
- package/src/handlers/rules/image.inline.ts +0 -8
- package/src/handlers/rules/image.ts +0 -7
- package/src/handlers/rules/index.ts +0 -33
- package/src/handlers/rules/svg.inline.test.ts +0 -31
- package/src/handlers/rules/svg.ts +0 -7
- package/src/handlers/rules/toml.test.ts +0 -23
- package/src/handlers/rules/webp.ts +0 -7
- package/src/handlers/rules/yml.ts +0 -7
- package/src/rule/index.test.ts +0 -88
- package/src/types.ts +0 -57
- /package/lib/{handlers/items/items.js → items/index.js} +0 -0
- /package/lib/{handlers/loaders/loaders.js → loaders/index.js} +0 -0
package/lib/item/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { __decorate
|
|
2
|
-
import { basename } from 'path';
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { basename } from 'node:path';
|
|
3
|
+
import Registrable from '@roots/bud-build/helpers/registrable';
|
|
4
|
+
import Loader from '@roots/bud-build/loader';
|
|
3
5
|
import { bind } from '@roots/bud-support/decorators/bind';
|
|
4
6
|
import isString from '@roots/bud-support/lodash/isString';
|
|
5
|
-
import { Loader } from '../loader/index.js';
|
|
6
|
-
import Base from '../shared/base.js';
|
|
7
7
|
/**
|
|
8
8
|
* Item class
|
|
9
9
|
*/
|
|
10
|
-
class Item extends
|
|
10
|
+
class Item extends Registrable {
|
|
11
11
|
_app;
|
|
12
12
|
/**
|
|
13
13
|
* Identifier
|
|
@@ -107,51 +107,27 @@ class Item extends Base {
|
|
|
107
107
|
}
|
|
108
108
|
}
|
|
109
109
|
__decorate([
|
|
110
|
-
bind
|
|
111
|
-
__metadata("design:type", Function),
|
|
112
|
-
__metadata("design:paramtypes", []),
|
|
113
|
-
__metadata("design:returntype", Object)
|
|
110
|
+
bind
|
|
114
111
|
], Item.prototype, "getIdent", null);
|
|
115
112
|
__decorate([
|
|
116
|
-
bind
|
|
117
|
-
__metadata("design:type", Function),
|
|
118
|
-
__metadata("design:paramtypes", []),
|
|
119
|
-
__metadata("design:returntype", Loader)
|
|
113
|
+
bind
|
|
120
114
|
], Item.prototype, "getLoader", null);
|
|
121
115
|
__decorate([
|
|
122
|
-
bind
|
|
123
|
-
__metadata("design:type", Function),
|
|
124
|
-
__metadata("design:paramtypes", []),
|
|
125
|
-
__metadata("design:returntype", Object)
|
|
116
|
+
bind
|
|
126
117
|
], Item.prototype, "getOptions", null);
|
|
127
118
|
__decorate([
|
|
128
|
-
bind
|
|
129
|
-
__metadata("design:type", Function),
|
|
130
|
-
__metadata("design:paramtypes", [Object]),
|
|
131
|
-
__metadata("design:returntype", Object)
|
|
119
|
+
bind
|
|
132
120
|
], Item.prototype, "mergeOptions", null);
|
|
133
121
|
__decorate([
|
|
134
|
-
bind
|
|
135
|
-
__metadata("design:type", Function),
|
|
136
|
-
__metadata("design:paramtypes", [Object]),
|
|
137
|
-
__metadata("design:returntype", Object)
|
|
122
|
+
bind
|
|
138
123
|
], Item.prototype, "setIdent", null);
|
|
139
124
|
__decorate([
|
|
140
|
-
bind
|
|
141
|
-
__metadata("design:type", Function),
|
|
142
|
-
__metadata("design:paramtypes", [Object]),
|
|
143
|
-
__metadata("design:returntype", Object)
|
|
125
|
+
bind
|
|
144
126
|
], Item.prototype, "setLoader", null);
|
|
145
127
|
__decorate([
|
|
146
|
-
bind
|
|
147
|
-
__metadata("design:type", Function),
|
|
148
|
-
__metadata("design:paramtypes", [Object]),
|
|
149
|
-
__metadata("design:returntype", void 0)
|
|
128
|
+
bind
|
|
150
129
|
], Item.prototype, "setOptions", null);
|
|
151
130
|
__decorate([
|
|
152
|
-
bind
|
|
153
|
-
__metadata("design:type", Function),
|
|
154
|
-
__metadata("design:paramtypes", []),
|
|
155
|
-
__metadata("design:returntype", Object)
|
|
131
|
+
bind
|
|
156
132
|
], Item.prototype, "toWebpack", null);
|
|
157
|
-
export { Item };
|
|
133
|
+
export { Item as default };
|
package/lib/loader/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { Bud } from '@roots/bud-framework';
|
|
2
|
-
import
|
|
2
|
+
import Registrable from '@roots/bud-build/helpers/registrable';
|
|
3
3
|
/**
|
|
4
4
|
* Bud Loader
|
|
5
5
|
*/
|
|
6
|
-
declare class Loader extends
|
|
6
|
+
declare class Loader extends Registrable {
|
|
7
7
|
_app: () => Bud;
|
|
8
8
|
/**
|
|
9
9
|
* Factory returning the loader path
|
|
@@ -14,8 +14,8 @@ declare class Loader extends Base {
|
|
|
14
14
|
*
|
|
15
15
|
* @param src - Either a factory returning a string or a literal string
|
|
16
16
|
*/
|
|
17
|
-
constructor(_app: () => Bud, src
|
|
17
|
+
constructor(_app: () => Bud, src?: string, definition?: string);
|
|
18
18
|
getSrc(): string;
|
|
19
19
|
setSrc(src: string): this;
|
|
20
20
|
}
|
|
21
|
-
export { Loader };
|
|
21
|
+
export { Loader as default };
|
package/lib/loader/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import Registrable from '@roots/bud-build/helpers/registrable';
|
|
2
2
|
/**
|
|
3
3
|
* Bud Loader
|
|
4
4
|
*/
|
|
5
|
-
class Loader extends
|
|
5
|
+
class Loader extends Registrable {
|
|
6
6
|
_app;
|
|
7
7
|
/**
|
|
8
8
|
* Factory returning the loader path
|
|
@@ -17,7 +17,7 @@ class Loader extends Base {
|
|
|
17
17
|
super(_app);
|
|
18
18
|
this._app = _app;
|
|
19
19
|
this._app = _app;
|
|
20
|
-
this.src = definition ?? src
|
|
20
|
+
this.src = definition ?? src ?? ``;
|
|
21
21
|
}
|
|
22
22
|
getSrc() {
|
|
23
23
|
return this.src;
|
|
@@ -27,4 +27,4 @@ class Loader extends Base {
|
|
|
27
27
|
return this;
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
|
-
export { Loader };
|
|
30
|
+
export { Loader as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import type { Factory } from '@roots/bud-build/registry';
|
|
1
2
|
import type { Loader } from '@roots/bud-framework/services/build';
|
|
2
|
-
import type { Factory } from '../index.js';
|
|
3
3
|
export declare const css: Factory<Loader>;
|
|
4
4
|
export declare const csv: Factory<Loader>;
|
|
5
5
|
export declare const file: Factory<Loader>;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type Rule from '@roots/bud-build/rule';
|
|
2
|
+
import type { Bud } from '@roots/bud-framework';
|
|
3
|
+
import * as items from '@roots/bud-build/items';
|
|
4
|
+
import * as loaders from '@roots/bud-build/loaders';
|
|
5
|
+
import * as rules from '@roots/bud-build/rules';
|
|
6
|
+
interface Props {
|
|
7
|
+
filter: Bud[`hooks`][`filter`];
|
|
8
|
+
isProduction: Bud[`isProduction`];
|
|
9
|
+
makeItem: Bud[`build`][`makeItem`];
|
|
10
|
+
makeLoader: Bud[`build`][`makeLoader`];
|
|
11
|
+
makeRule: Bud[`build`][`makeRule`];
|
|
12
|
+
path: Bud[`path`];
|
|
13
|
+
resolve: Bud[`module`][`resolve`];
|
|
14
|
+
}
|
|
15
|
+
interface Factory<T = Rule> {
|
|
16
|
+
(props: Props): Promise<T>;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Register built-in {@link loaders}, {@link items} and {@link rules}
|
|
20
|
+
*/
|
|
21
|
+
declare function register(bud: Bud): Promise<void>;
|
|
22
|
+
/**
|
|
23
|
+
* Registry factory curry function
|
|
24
|
+
*/
|
|
25
|
+
interface makeRegister {
|
|
26
|
+
<T, F extends CallableFunction>(props: Partial<Bud>, setRule: F): <K extends keyof T & string>([key, factory]: [
|
|
27
|
+
K,
|
|
28
|
+
Factory<T[K]>
|
|
29
|
+
]) => void;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Registry factory
|
|
33
|
+
*/
|
|
34
|
+
declare const makeRegister: makeRegister;
|
|
35
|
+
export { items, loaders, makeRegister, register, rules };
|
|
36
|
+
export type { Factory, Props };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import * as items from '
|
|
2
|
-
import * as loaders from '
|
|
3
|
-
import
|
|
1
|
+
import * as items from '@roots/bud-build/items';
|
|
2
|
+
import * as loaders from '@roots/bud-build/loaders';
|
|
3
|
+
import * as rules from '@roots/bud-build/rules';
|
|
4
4
|
/**
|
|
5
5
|
* Register built-in {@link loaders}, {@link items} and {@link rules}
|
|
6
6
|
*/
|
|
7
|
-
|
|
7
|
+
async function register(bud) {
|
|
8
8
|
await Promise.all([
|
|
9
9
|
...Object.entries(loaders).map(makeRegister(bud, bud.build.setLoader)),
|
|
10
10
|
...Object.entries(items).map(makeRegister(bud, bud.build.setItem)),
|
|
@@ -17,7 +17,10 @@ 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
|
-
|
|
20
|
+
/**
|
|
21
|
+
* Registry factory
|
|
22
|
+
*/
|
|
23
|
+
const makeRegister = ({ build, hooks, isProduction, module: { resolve }, path }, setRule) => async ([key, factory]) => setRule(key, await factory({
|
|
21
24
|
filter: hooks.filter,
|
|
22
25
|
isProduction,
|
|
23
26
|
makeItem: build.makeItem,
|
|
@@ -26,3 +29,4 @@ export const makeRegister = ({ build, hooks, isProduction, module: { resolve },
|
|
|
26
29
|
path,
|
|
27
30
|
resolve,
|
|
28
31
|
}));
|
|
32
|
+
export { items, loaders, makeRegister, register, rules };
|
package/lib/rule/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { Bud } from '@roots/bud-framework';
|
|
2
2
|
import type { RuleSetRule } from '@roots/bud-framework/config';
|
|
3
3
|
import type { Rule as Interface, Options, Output, Parser } from '@roots/bud-framework/services/build/rule';
|
|
4
|
-
import
|
|
4
|
+
import Registrable from '@roots/bud-build/helpers/registrable';
|
|
5
5
|
/**
|
|
6
6
|
* RuleSetRule
|
|
7
7
|
*/
|
|
8
|
-
declare class Rule extends
|
|
8
|
+
declare class Rule extends Registrable implements Interface {
|
|
9
9
|
/**
|
|
10
10
|
* RuleSetRule exclude
|
|
11
11
|
*/
|
|
@@ -125,5 +125,5 @@ declare class Rule extends Base implements Interface {
|
|
|
125
125
|
*/
|
|
126
126
|
toWebpack(): Output & RuleSetRule;
|
|
127
127
|
}
|
|
128
|
-
export { Rule };
|
|
128
|
+
export { Rule as default };
|
|
129
129
|
export type { Interface, Options, Output, Parser };
|
package/lib/rule/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { __decorate
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import Registrable from '@roots/bud-build/helpers/registrable';
|
|
2
3
|
import { bind } from '@roots/bud-support/decorators/bind';
|
|
3
4
|
import isFunction from '@roots/bud-support/lodash/isFunction';
|
|
4
5
|
import isString from '@roots/bud-support/lodash/isString';
|
|
5
|
-
import Base from '../shared/base.js';
|
|
6
6
|
/**
|
|
7
7
|
* RuleSetRule
|
|
8
8
|
*/
|
|
9
|
-
class Rule extends
|
|
9
|
+
class Rule extends Registrable {
|
|
10
10
|
/**
|
|
11
11
|
* RuleSetRule exclude
|
|
12
12
|
*/
|
|
@@ -211,111 +211,57 @@ class Rule extends Base {
|
|
|
211
211
|
}
|
|
212
212
|
}
|
|
213
213
|
__decorate([
|
|
214
|
-
bind
|
|
215
|
-
__metadata("design:type", Function),
|
|
216
|
-
__metadata("design:paramtypes", []),
|
|
217
|
-
__metadata("design:returntype", Array)
|
|
214
|
+
bind
|
|
218
215
|
], Rule.prototype, "getExclude", null);
|
|
219
216
|
__decorate([
|
|
220
|
-
bind
|
|
221
|
-
__metadata("design:type", Function),
|
|
222
|
-
__metadata("design:paramtypes", []),
|
|
223
|
-
__metadata("design:returntype", void 0)
|
|
217
|
+
bind
|
|
224
218
|
], Rule.prototype, "getGenerator", null);
|
|
225
219
|
__decorate([
|
|
226
|
-
bind
|
|
227
|
-
__metadata("design:type", Function),
|
|
228
|
-
__metadata("design:paramtypes", []),
|
|
229
|
-
__metadata("design:returntype", Array)
|
|
220
|
+
bind
|
|
230
221
|
], Rule.prototype, "getInclude", null);
|
|
231
222
|
__decorate([
|
|
232
|
-
bind
|
|
233
|
-
__metadata("design:type", Function),
|
|
234
|
-
__metadata("design:paramtypes", []),
|
|
235
|
-
__metadata("design:returntype", Object)
|
|
223
|
+
bind
|
|
236
224
|
], Rule.prototype, "getParser", null);
|
|
237
225
|
__decorate([
|
|
238
|
-
bind
|
|
239
|
-
__metadata("design:type", Function),
|
|
240
|
-
__metadata("design:paramtypes", []),
|
|
241
|
-
__metadata("design:returntype", Object)
|
|
226
|
+
bind
|
|
242
227
|
], Rule.prototype, "getResourceQuery", null);
|
|
243
228
|
__decorate([
|
|
244
|
-
bind
|
|
245
|
-
__metadata("design:type", Function),
|
|
246
|
-
__metadata("design:paramtypes", []),
|
|
247
|
-
__metadata("design:returntype", Object)
|
|
229
|
+
bind
|
|
248
230
|
], Rule.prototype, "getTest", null);
|
|
249
231
|
__decorate([
|
|
250
|
-
bind
|
|
251
|
-
__metadata("design:type", Function),
|
|
252
|
-
__metadata("design:paramtypes", []),
|
|
253
|
-
__metadata("design:returntype", String)
|
|
232
|
+
bind
|
|
254
233
|
], Rule.prototype, "getType", null);
|
|
255
234
|
__decorate([
|
|
256
|
-
bind
|
|
257
|
-
__metadata("design:type", Function),
|
|
258
|
-
__metadata("design:paramtypes", []),
|
|
259
|
-
__metadata("design:returntype", Object)
|
|
235
|
+
bind
|
|
260
236
|
], Rule.prototype, "getUse", null);
|
|
261
237
|
__decorate([
|
|
262
|
-
bind
|
|
263
|
-
__metadata("design:type", Function),
|
|
264
|
-
__metadata("design:paramtypes", [Object]),
|
|
265
|
-
__metadata("design:returntype", Object)
|
|
238
|
+
bind
|
|
266
239
|
], Rule.prototype, "setExclude", null);
|
|
267
240
|
__decorate([
|
|
268
|
-
bind
|
|
269
|
-
__metadata("design:type", Function),
|
|
270
|
-
__metadata("design:paramtypes", [Object]),
|
|
271
|
-
__metadata("design:returntype", Object)
|
|
241
|
+
bind
|
|
272
242
|
], Rule.prototype, "setGenerator", null);
|
|
273
243
|
__decorate([
|
|
274
|
-
bind
|
|
275
|
-
__metadata("design:type", Function),
|
|
276
|
-
__metadata("design:paramtypes", [Object]),
|
|
277
|
-
__metadata("design:returntype", Object)
|
|
244
|
+
bind
|
|
278
245
|
], Rule.prototype, "setInclude", null);
|
|
279
246
|
__decorate([
|
|
280
|
-
bind
|
|
281
|
-
__metadata("design:type", Function),
|
|
282
|
-
__metadata("design:paramtypes", [Object]),
|
|
283
|
-
__metadata("design:returntype", Object)
|
|
247
|
+
bind
|
|
284
248
|
], Rule.prototype, "setParser", null);
|
|
285
249
|
__decorate([
|
|
286
|
-
bind
|
|
287
|
-
__metadata("design:type", Function),
|
|
288
|
-
__metadata("design:paramtypes", [Object]),
|
|
289
|
-
__metadata("design:returntype", Object)
|
|
250
|
+
bind
|
|
290
251
|
], Rule.prototype, "setResolve", null);
|
|
291
252
|
__decorate([
|
|
292
|
-
bind
|
|
293
|
-
__metadata("design:type", Function),
|
|
294
|
-
__metadata("design:paramtypes", [Object]),
|
|
295
|
-
__metadata("design:returntype", Object)
|
|
253
|
+
bind
|
|
296
254
|
], Rule.prototype, "setResourceQuery", null);
|
|
297
255
|
__decorate([
|
|
298
|
-
bind
|
|
299
|
-
__metadata("design:type", Function),
|
|
300
|
-
__metadata("design:paramtypes", [Object]),
|
|
301
|
-
__metadata("design:returntype", Object)
|
|
256
|
+
bind
|
|
302
257
|
], Rule.prototype, "setTest", null);
|
|
303
258
|
__decorate([
|
|
304
|
-
bind
|
|
305
|
-
__metadata("design:type", Function),
|
|
306
|
-
__metadata("design:paramtypes", [Object]),
|
|
307
|
-
__metadata("design:returntype", Object)
|
|
259
|
+
bind
|
|
308
260
|
], Rule.prototype, "setType", null);
|
|
309
261
|
__decorate([
|
|
310
|
-
bind
|
|
311
|
-
__metadata("design:type", Function),
|
|
312
|
-
__metadata("design:paramtypes", [Object]),
|
|
313
|
-
__metadata("design:returntype", Object)
|
|
262
|
+
bind
|
|
314
263
|
], Rule.prototype, "setUse", null);
|
|
315
264
|
__decorate([
|
|
316
|
-
bind
|
|
317
|
-
__metadata("design:type", Function),
|
|
318
|
-
__metadata("design:paramtypes", []),
|
|
319
|
-
__metadata("design:returntype", Object)
|
|
265
|
+
bind
|
|
320
266
|
], Rule.prototype, "toWebpack", null);
|
|
321
|
-
export { Rule };
|
|
267
|
+
export { Rule as default };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
const cssModule = async ({ filter, makeRule, path }) => makeRule()
|
|
2
2
|
.setTest(filter(`pattern.cssModule`))
|
|
3
3
|
.setInclude([() => path(`@src`)])
|
|
4
4
|
.setUse([`precss`, `cssModule`]);
|
|
5
|
+
export { cssModule as default };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
const inlineFont = async ({ filter, makeRule, path }) => makeRule()
|
|
2
2
|
.setTest(filter(`pattern.font`))
|
|
3
3
|
.setInclude([() => path(`@src`)])
|
|
4
4
|
.setResourceQuery(/inline/)
|
|
5
5
|
.setType(`asset/inline`);
|
|
6
|
+
export { inlineFont as default };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
const inlineImage = async ({ filter, makeRule, path }) => makeRule()
|
|
2
2
|
.setTest(filter(`pattern.image`))
|
|
3
3
|
.setInclude([() => path(`@src`)])
|
|
4
4
|
.setType(`asset/inline`)
|
|
5
5
|
.setResourceQuery(/inline/);
|
|
6
|
+
export { inlineImage as default };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
const image = async ({ filter, makeRule, path }) => makeRule()
|
|
2
|
+
.setTest(filter(`pattern.image`))
|
|
3
|
+
.setInclude([() => path(`@src`)])
|
|
4
|
+
.setType(`asset/resource`)
|
|
5
|
+
.setGenerator({
|
|
6
|
+
filename: `[path][name].[contenthash][ext][query]`,
|
|
7
|
+
});
|
|
8
|
+
export { image as default };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export { default as css } from '@roots/bud-build/rules/css';
|
|
2
|
+
export { default as cssModule } from '@roots/bud-build/rules/css.module';
|
|
3
|
+
export { default as csv } from '@roots/bud-build/rules/csv';
|
|
4
|
+
export { default as font } from '@roots/bud-build/rules/font';
|
|
5
|
+
export { default as inlineFont } from '@roots/bud-build/rules/font.inline';
|
|
6
|
+
export { default as html } from '@roots/bud-build/rules/html';
|
|
7
|
+
export { default as image } from '@roots/bud-build/rules/image';
|
|
8
|
+
export { default as inlineImage } from '@roots/bud-build/rules/image.inline';
|
|
9
|
+
export { default as js } from '@roots/bud-build/rules/js';
|
|
10
|
+
export { default as json } from '@roots/bud-build/rules/json';
|
|
11
|
+
export { default as svg } from '@roots/bud-build/rules/svg';
|
|
12
|
+
export { default as inlineSvg } from '@roots/bud-build/rules/svg.inline';
|
|
13
|
+
export { default as toml } from '@roots/bud-build/rules/toml';
|
|
14
|
+
export { default as webp } from '@roots/bud-build/rules/webp';
|
|
15
|
+
export { default as yml } from '@roots/bud-build/rules/yml';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export { default as css } from '@roots/bud-build/rules/css';
|
|
2
|
+
export { default as cssModule } from '@roots/bud-build/rules/css.module';
|
|
3
|
+
export { default as csv } from '@roots/bud-build/rules/csv';
|
|
4
|
+
export { default as font } from '@roots/bud-build/rules/font';
|
|
5
|
+
export { default as inlineFont } from '@roots/bud-build/rules/font.inline';
|
|
6
|
+
export { default as html } from '@roots/bud-build/rules/html';
|
|
7
|
+
export { default as image } from '@roots/bud-build/rules/image';
|
|
8
|
+
export { default as inlineImage } from '@roots/bud-build/rules/image.inline';
|
|
9
|
+
export { default as js } from '@roots/bud-build/rules/js';
|
|
10
|
+
export { default as json } from '@roots/bud-build/rules/json';
|
|
11
|
+
export { default as svg } from '@roots/bud-build/rules/svg';
|
|
12
|
+
export { default as inlineSvg } from '@roots/bud-build/rules/svg.inline';
|
|
13
|
+
export { default as toml } from '@roots/bud-build/rules/toml';
|
|
14
|
+
export { default as webp } from '@roots/bud-build/rules/webp';
|
|
15
|
+
export { default as yml } from '@roots/bud-build/rules/yml';
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
const js = async ({ filter, makeRule, path }) => makeRule()
|
|
2
2
|
.setTest(filter(`pattern.js`))
|
|
3
3
|
.setInclude([() => path(`@src`)])
|
|
4
4
|
.setResolve({
|
|
5
5
|
fullySpecified: false,
|
|
6
6
|
});
|
|
7
|
+
export { js as default };
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import json5 from '@roots/bud-support/json5';
|
|
2
|
-
|
|
2
|
+
const json = async ({ filter, makeRule, path }) => makeRule()
|
|
3
3
|
.setType(`json`)
|
|
4
4
|
.setInclude([() => path()])
|
|
5
5
|
.setTest(filter(`pattern.json`))
|
|
6
6
|
.setParser({
|
|
7
7
|
parse: json5.parse,
|
|
8
8
|
});
|
|
9
|
+
export { json as default };
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import dataUri from '@roots/bud-support/mini-svg-data-uri';
|
|
2
|
-
|
|
2
|
+
const inlineSvg = async ({ filter, makeRule, path }) => makeRule()
|
|
3
3
|
.setTest(filter(`pattern.svg`))
|
|
4
4
|
.setInclude([() => path(`@src`)])
|
|
5
5
|
.setResourceQuery(/inline/)
|
|
6
6
|
.setGenerator({ dataUrl })
|
|
7
7
|
.setType(`asset/inline`);
|
|
8
|
-
|
|
8
|
+
const dataUrl = (data) => dataUri(data.toString());
|
|
9
|
+
export { dataUrl, inlineSvg as default };
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import tomlParser from '@roots/bud-support/toml';
|
|
2
|
-
|
|
2
|
+
const toml = async ({ filter, makeRule, path }) => makeRule()
|
|
3
3
|
.setType(`json`)
|
|
4
4
|
.setInclude([() => path()])
|
|
5
5
|
.setTest(() => filter(`pattern.toml`))
|
|
6
6
|
.setParser({
|
|
7
7
|
parse: tomlParser.parse,
|
|
8
8
|
});
|
|
9
|
+
export { toml as default };
|