@rollup-extras/plugin-html 1.3.4 → 1.4.1
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/LICENSE +1 -1
- package/README.md +40 -14
- package/asset-factories/package.json +5 -0
- package/dist/asset-factories.cjs +61 -0
- package/dist/asset-factories.d.ts +6 -0
- package/dist/asset-factories.mjs +56 -0
- package/dist/index.cjs +268 -285
- package/dist/index.d.ts +7 -7
- package/dist/index.mjs +268 -285
- package/dist/shared.cjs +31 -0
- package/dist/shared.d.ts +5 -0
- package/dist/shared.mjs +26 -0
- package/dist/types.d.ts +37 -34
- package/package.json +19 -29
package/dist/types.d.ts
CHANGED
|
@@ -1,34 +1,37 @@
|
|
|
1
|
-
import { InternalModuleFormat } from 'rollup';
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
export
|
|
19
|
-
export
|
|
20
|
-
export
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
1
|
+
import { InternalModuleFormat } from 'rollup';
|
|
2
|
+
export type PredicateSource = boolean | AssetPredicate | RegExp | string;
|
|
3
|
+
export type AssetType = 'asset' | InternalModuleFormat;
|
|
4
|
+
export type Assets = {
|
|
5
|
+
[key in AssetType]?: AssetDescriptor[];
|
|
6
|
+
};
|
|
7
|
+
export type AssetPredicate = (fileName: string) => boolean;
|
|
8
|
+
export type AssetDescriptor = {
|
|
9
|
+
html: string | ((assets: Assets, context?: unknown) => string | unknown);
|
|
10
|
+
head: boolean;
|
|
11
|
+
type: 'asset' | InternalModuleFormat;
|
|
12
|
+
};
|
|
13
|
+
export type SimpleAssetDescriptor = {
|
|
14
|
+
html: string;
|
|
15
|
+
head: boolean;
|
|
16
|
+
type: 'asset' | InternalModuleFormat;
|
|
17
|
+
};
|
|
18
|
+
export type AssetFactory = (fileName: string, content: string | Uint8Array, type: 'asset' | InternalModuleFormat) => AssetDescriptor | string | undefined | Promise<AssetDescriptor | string | undefined>;
|
|
19
|
+
export type DefaultTemplateFactory = (initialTemplate: string, assets: Assets) => string;
|
|
20
|
+
export type TemplateFactory = (initialTemplate: string, assets: Assets, defaultTemplateFactory: DefaultTemplateFactory) => string | Uint8Array | Promise<string | Uint8Array>;
|
|
21
|
+
export type HtmlPluginOptions = {
|
|
22
|
+
pluginName?: string;
|
|
23
|
+
outputFile?: string;
|
|
24
|
+
template?: string;
|
|
25
|
+
watch?: boolean;
|
|
26
|
+
emitFile?: boolean | 'auto';
|
|
27
|
+
verbose?: boolean;
|
|
28
|
+
useWriteBundle?: boolean;
|
|
29
|
+
useEmittedTemplate?: boolean;
|
|
30
|
+
conditionalLoading?: boolean;
|
|
31
|
+
injectIntoHead?: PredicateSource;
|
|
32
|
+
ignore?: PredicateSource;
|
|
33
|
+
assetsFactory?: AssetFactory;
|
|
34
|
+
templateFactory?: TemplateFactory;
|
|
35
|
+
};
|
|
36
|
+
export type Extends<T1, T2> = T1 extends T2 ? true : false;
|
|
37
|
+
export type Expect<T extends true> = T;
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "1.
|
|
2
|
+
"version": "1.4.1",
|
|
3
3
|
"license": "MIT",
|
|
4
4
|
"name": "@rollup-extras/plugin-html",
|
|
5
5
|
"author": {
|
|
@@ -11,6 +11,10 @@
|
|
|
11
11
|
"require": "./dist/index.cjs",
|
|
12
12
|
"default": "./dist/index.mjs"
|
|
13
13
|
},
|
|
14
|
+
"./asset-factories": {
|
|
15
|
+
"require": "./dist/asset-factories.cjs",
|
|
16
|
+
"default": "./dist/asset-factories.mjs"
|
|
17
|
+
},
|
|
14
18
|
"./package.json": "./package.json"
|
|
15
19
|
},
|
|
16
20
|
"main": "./dist/index.cjs",
|
|
@@ -18,7 +22,8 @@
|
|
|
18
22
|
"typings": "./dist/index.d.ts",
|
|
19
23
|
"files": [
|
|
20
24
|
"dist",
|
|
21
|
-
"LICENSE"
|
|
25
|
+
"LICENSE",
|
|
26
|
+
"asset-factories"
|
|
22
27
|
],
|
|
23
28
|
"engines": {
|
|
24
29
|
"node": ">=15"
|
|
@@ -38,36 +43,21 @@
|
|
|
38
43
|
"html",
|
|
39
44
|
"bundle"
|
|
40
45
|
],
|
|
41
|
-
"scripts": {
|
|
42
|
-
"build": "pkgbld-internal",
|
|
43
|
-
"test": "jest --collectCoverage",
|
|
44
|
-
"lint": "eslint ./src",
|
|
45
|
-
"semantic-release": "npx semantic-release"
|
|
46
|
-
},
|
|
47
|
-
"devDependencies": {
|
|
48
|
-
"@semantic-release/changelog": "6.0.1",
|
|
49
|
-
"@semantic-release/commit-analyzer": "9.0.2",
|
|
50
|
-
"@semantic-release/git": "10.0.1",
|
|
51
|
-
"@semantic-release/npm": "9.0.1",
|
|
52
|
-
"@semantic-release/release-notes-generator": "10.0.3",
|
|
53
|
-
"@types/jest": "27.5.1",
|
|
54
|
-
"@typescript-eslint/eslint-plugin": "5.24.0",
|
|
55
|
-
"@typescript-eslint/parser": "5.24.0",
|
|
56
|
-
"conventional-changelog-angular": "5.0.13",
|
|
57
|
-
"eslint": "8.15.0",
|
|
58
|
-
"jest": "28.1.0",
|
|
59
|
-
"semantic-release": "19.0.3",
|
|
60
|
-
"semantic-release-monorepo": "7.0.5",
|
|
61
|
-
"ts-jest": "28.0.2",
|
|
62
|
-
"typescript": "4.6.x",
|
|
63
|
-
"update-monorepo-package-json": "0.2.0",
|
|
64
|
-
"pkgbld-internal": "1.0.3"
|
|
65
|
-
},
|
|
66
46
|
"peerDependencies": {
|
|
67
47
|
"rollup": "^2.60.1 || ^3.0.0"
|
|
68
48
|
},
|
|
49
|
+
"peerDependenciesMeta": {
|
|
50
|
+
"rollup": {
|
|
51
|
+
"optional": true
|
|
52
|
+
}
|
|
53
|
+
},
|
|
69
54
|
"dependencies": {
|
|
70
55
|
"@niceties/logger": "^1.1.4",
|
|
71
|
-
"@rollup-extras/utils": "^1.
|
|
56
|
+
"@rollup-extras/utils": "^1.4.1"
|
|
57
|
+
},
|
|
58
|
+
"scripts": {
|
|
59
|
+
"build": "pkgbld-internal",
|
|
60
|
+
"test": "jest --collectCoverage",
|
|
61
|
+
"lint": "eslint ./src"
|
|
72
62
|
}
|
|
73
|
-
}
|
|
63
|
+
}
|