@web/rollup-plugin-html 0.0.0-canary-20230416222938 → 0.0.0-canary-20231122093600
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/dist/RollupPluginHTMLOptions.d.ts +2 -2
- package/dist/RollupPluginHTMLOptions.d.ts.map +1 -1
- package/dist/RollupPluginHTMLOptions.js +1 -2
- package/dist/assets/utils.js +31 -43
- package/dist/assets/utils.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -6
- package/dist/index.js.map +1 -1
- package/dist/input/InputData.js +1 -2
- package/dist/input/addRollupInput.d.ts +1 -1
- package/dist/input/addRollupInput.d.ts.map +1 -1
- package/dist/input/addRollupInput.js +23 -16
- package/dist/input/addRollupInput.js.map +1 -1
- package/dist/input/extract/extractAssets.d.ts +1 -1
- package/dist/input/extract/extractAssets.d.ts.map +1 -1
- package/dist/input/extract/extractAssets.js +13 -20
- package/dist/input/extract/extractAssets.js.map +1 -1
- package/dist/input/extract/extractModules.d.ts +1 -1
- package/dist/input/extract/extractModules.d.ts.map +1 -1
- package/dist/input/extract/extractModules.js +16 -23
- package/dist/input/extract/extractModules.js.map +1 -1
- package/dist/input/extract/extractModulesAndAssets.d.ts +3 -3
- package/dist/input/extract/extractModulesAndAssets.js +10 -17
- package/dist/input/extract/extractModulesAndAssets.js.map +1 -1
- package/dist/input/getInputData.d.ts +2 -2
- package/dist/input/getInputData.d.ts.map +1 -1
- package/dist/input/getInputData.js +19 -27
- package/dist/input/getInputData.js.map +1 -1
- package/dist/input/normalizeInputOptions.d.ts +1 -1
- package/dist/input/normalizeInputOptions.d.ts.map +1 -1
- package/dist/input/normalizeInputOptions.js +5 -9
- package/dist/input/normalizeInputOptions.js.map +1 -1
- package/dist/output/createHTMLOutput.d.ts +3 -3
- package/dist/output/createHTMLOutput.d.ts.map +1 -1
- package/dist/output/createHTMLOutput.js +9 -14
- package/dist/output/createHTMLOutput.js.map +1 -1
- package/dist/output/emitAssets.js +4 -11
- package/dist/output/emitAssets.js.map +1 -1
- package/dist/output/getEntrypointBundles.js +12 -21
- package/dist/output/getEntrypointBundles.js.map +1 -1
- package/dist/output/getOutputHTML.d.ts +1 -1
- package/dist/output/getOutputHTML.d.ts.map +1 -1
- package/dist/output/getOutputHTML.js +20 -35
- package/dist/output/getOutputHTML.js.map +1 -1
- package/dist/output/hashInlineScripts.js +19 -23
- package/dist/output/hashInlineScripts.js.map +1 -1
- package/dist/output/injectAbsoluteBaseUrl.js +10 -14
- package/dist/output/injectAbsoluteBaseUrl.js.map +1 -1
- package/dist/output/injectBundles.d.ts +1 -1
- package/dist/output/injectBundles.d.ts.map +1 -1
- package/dist/output/injectBundles.js +10 -15
- package/dist/output/injectBundles.js.map +1 -1
- package/dist/output/injectServiceWorkerRegistration.js +10 -17
- package/dist/output/injectServiceWorkerRegistration.js.map +1 -1
- package/dist/output/injectedUpdatedAssetPaths.d.ts +2 -2
- package/dist/output/injectedUpdatedAssetPaths.d.ts.map +1 -1
- package/dist/output/injectedUpdatedAssetPaths.js +21 -28
- package/dist/output/injectedUpdatedAssetPaths.js.map +1 -1
- package/dist/output/utils.js +3 -10
- package/dist/output/utils.js.map +1 -1
- package/dist/rollupPluginHTML.d.ts +2 -2
- package/dist/rollupPluginHTML.d.ts.map +1 -1
- package/dist/rollupPluginHTML.js +24 -31
- package/dist/rollupPluginHTML.js.map +1 -1
- package/dist/utils.d.ts +1 -1
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +2 -6
- package/dist/utils.js.map +1 -1
- package/index.mjs +1 -4
- package/package.json +10 -8
- package/src/assets/utils.ts +1 -1
- package/src/index.ts +2 -2
- package/src/input/addRollupInput.ts +2 -2
- package/src/input/extract/extractAssets.ts +2 -2
- package/src/input/extract/extractModules.ts +2 -2
- package/src/input/extract/extractModulesAndAssets.ts +2 -2
- package/src/input/getInputData.ts +8 -8
- package/src/input/normalizeInputOptions.ts +2 -2
- package/src/output/createHTMLOutput.ts +6 -6
- package/src/output/getEntrypointBundles.ts +2 -2
- package/src/output/getOutputHTML.ts +6 -6
- package/src/output/injectBundles.ts +2 -2
- package/src/output/injectedUpdatedAssetPaths.ts +5 -5
- package/src/rollupPluginHTML.ts +7 -7
- package/src/utils.ts +1 -1
|
@@ -1,31 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const fs_1 = __importDefault(require("fs"));
|
|
8
|
-
const path_1 = __importDefault(require("path"));
|
|
9
|
-
const glob_1 = __importDefault(require("glob"));
|
|
10
|
-
const utils_1 = require("../utils");
|
|
11
|
-
const normalizeInputOptions_1 = require("./normalizeInputOptions");
|
|
12
|
-
const extractModulesAndAssets_1 = require("./extract/extractModulesAndAssets");
|
|
1
|
+
import fs from 'fs';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
import { globSync } from 'glob';
|
|
4
|
+
import { createError } from '../utils.js';
|
|
5
|
+
import { normalizeInputOptions } from './normalizeInputOptions.js';
|
|
6
|
+
import { extractModulesAndAssets } from './extract/extractModulesAndAssets.js';
|
|
13
7
|
function resolveGlob(fromGlob, opts) {
|
|
14
|
-
const files =
|
|
8
|
+
const files = globSync(fromGlob, { ...opts, absolute: true });
|
|
15
9
|
return (files
|
|
16
10
|
// filter out directories
|
|
17
|
-
.filter(filePath => !
|
|
11
|
+
.filter(filePath => !fs.lstatSync(filePath).isDirectory()));
|
|
18
12
|
}
|
|
19
13
|
function getName(filePath, rootDir, flattenOutput = true) {
|
|
20
14
|
if (flattenOutput) {
|
|
21
|
-
return
|
|
15
|
+
return path.basename(filePath);
|
|
22
16
|
}
|
|
23
|
-
return
|
|
17
|
+
return path.relative(rootDir, filePath);
|
|
24
18
|
}
|
|
25
19
|
function createInputData(params) {
|
|
26
20
|
const { name, html, rootDir, filePath, extractAssets, absolutePathPrefix } = params;
|
|
27
|
-
const htmlFilePath = filePath ? filePath :
|
|
28
|
-
const result =
|
|
21
|
+
const htmlFilePath = filePath ? filePath : path.resolve(rootDir, name);
|
|
22
|
+
const result = extractModulesAndAssets({
|
|
29
23
|
html,
|
|
30
24
|
htmlFilePath,
|
|
31
25
|
rootDir,
|
|
@@ -41,14 +35,13 @@ function createInputData(params) {
|
|
|
41
35
|
filePath,
|
|
42
36
|
};
|
|
43
37
|
}
|
|
44
|
-
function getInputData(pluginOptions, rollupInput) {
|
|
45
|
-
var _a, _b;
|
|
38
|
+
export function getInputData(pluginOptions, rollupInput) {
|
|
46
39
|
const { rootDir = process.cwd(), flattenOutput, extractAssets = true, absolutePathPrefix, exclude: ignore, } = pluginOptions;
|
|
47
|
-
const allInputs =
|
|
40
|
+
const allInputs = normalizeInputOptions(pluginOptions, rollupInput);
|
|
48
41
|
const result = [];
|
|
49
42
|
for (const input of allInputs) {
|
|
50
43
|
if (typeof input.html === 'string') {
|
|
51
|
-
const name =
|
|
44
|
+
const name = input.name ?? 'index.html';
|
|
52
45
|
const data = createInputData({
|
|
53
46
|
name,
|
|
54
47
|
html: input.html,
|
|
@@ -64,8 +57,8 @@ function getInputData(pluginOptions, rollupInput) {
|
|
|
64
57
|
throw new Error(`Could not find any HTML files for pattern: ${input.path}, resolved relative to ${rootDir}`);
|
|
65
58
|
}
|
|
66
59
|
for (const filePath of filePaths) {
|
|
67
|
-
const name =
|
|
68
|
-
const html =
|
|
60
|
+
const name = input.name ?? getName(filePath, rootDir, flattenOutput);
|
|
61
|
+
const html = fs.readFileSync(filePath, 'utf-8');
|
|
69
62
|
const data = createInputData({
|
|
70
63
|
name,
|
|
71
64
|
html,
|
|
@@ -78,17 +71,16 @@ function getInputData(pluginOptions, rollupInput) {
|
|
|
78
71
|
}
|
|
79
72
|
}
|
|
80
73
|
else {
|
|
81
|
-
throw
|
|
74
|
+
throw createError('An input must specify either a path or html.');
|
|
82
75
|
}
|
|
83
76
|
}
|
|
84
77
|
for (const input of result) {
|
|
85
78
|
if (result.filter(r => r.name === input.name).length !== 1) {
|
|
86
|
-
throw
|
|
79
|
+
throw createError(`Found multiple HTML inputs configured with the same name, ` +
|
|
87
80
|
'or with no name which defaults to index.html. Set a unique name on the' +
|
|
88
81
|
'input option.');
|
|
89
82
|
}
|
|
90
83
|
}
|
|
91
84
|
return result;
|
|
92
85
|
}
|
|
93
|
-
exports.getInputData = getInputData;
|
|
94
86
|
//# sourceMappingURL=getInputData.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getInputData.js","sourceRoot":"","sources":["../../src/input/getInputData.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"getInputData.js","sourceRoot":"","sources":["../../src/input/getInputData.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,QAAQ,EAAiC,MAAM,MAAM,CAAC;AAE/D,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAG1C,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAE,uBAAuB,EAAE,MAAM,sCAAsC,CAAC;AAG/E,SAAS,WAAW,CAAC,QAAgB,EAAE,IAAmC;IACxE,MAAM,KAAK,GAAG,QAAQ,CAAC,QAAQ,EAAE,EAAE,GAAG,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;IAC9D,OAAO,CACL,KAAK;QACH,yBAAyB;SACxB,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,WAAW,EAAE,CAAC,CAC7D,CAAC;AACJ,CAAC;AAED,SAAS,OAAO,CAAC,QAAgB,EAAE,OAAe,EAAE,aAAa,GAAG,IAAI;IACtE,IAAI,aAAa,EAAE;QACjB,OAAO,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;KAChC;IACD,OAAO,IAAI,CAAC,Q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C"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { InputOption } from 'rollup';
|
|
2
|
-
import { InputHTMLOptions, RollupPluginHTMLOptions } from '../RollupPluginHTMLOptions';
|
|
2
|
+
import { InputHTMLOptions, RollupPluginHTMLOptions } from '../RollupPluginHTMLOptions.js';
|
|
3
3
|
export declare function normalizeInputOptions(pluginOptions: RollupPluginHTMLOptions, rollupInput?: InputOption): InputHTMLOptions[];
|
|
4
4
|
//# sourceMappingURL=normalizeInputOptions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"normalizeInputOptions.d.ts","sourceRoot":"","sources":["../../src/input/normalizeInputOptions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AACrC,OAAO,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"normalizeInputOptions.d.ts","sourceRoot":"","sources":["../../src/input/normalizeInputOptions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AACrC,OAAO,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAC;AAG1F,wBAAgB,qBAAqB,CACnC,aAAa,EAAE,uBAAuB,EACtC,WAAW,CAAC,EAAE,WAAW,GACxB,gBAAgB,EAAE,CAuCpB"}
|
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.normalizeInputOptions = void 0;
|
|
4
|
-
const utils_1 = require("../utils");
|
|
5
|
-
function normalizeInputOptions(pluginOptions, rollupInput) {
|
|
1
|
+
import { createError } from '../utils.js';
|
|
2
|
+
export function normalizeInputOptions(pluginOptions, rollupInput) {
|
|
6
3
|
if (pluginOptions.input == null) {
|
|
7
4
|
if (rollupInput == null) {
|
|
8
|
-
throw
|
|
5
|
+
throw createError('Missing input option in rollup or in HTML plugin options.');
|
|
9
6
|
}
|
|
10
7
|
if (typeof rollupInput === 'string') {
|
|
11
8
|
return [{ path: rollupInput }];
|
|
@@ -16,7 +13,7 @@ function normalizeInputOptions(pluginOptions, rollupInput) {
|
|
|
16
13
|
if (typeof rollupInput === 'object') {
|
|
17
14
|
return Object.entries(rollupInput).map(([name, path]) => ({ name, path }));
|
|
18
15
|
}
|
|
19
|
-
throw
|
|
16
|
+
throw createError('Unable to parse rollup input option');
|
|
20
17
|
}
|
|
21
18
|
if (Array.isArray(pluginOptions.input)) {
|
|
22
19
|
return pluginOptions.input.map(input => {
|
|
@@ -32,7 +29,6 @@ function normalizeInputOptions(pluginOptions, rollupInput) {
|
|
|
32
29
|
if (typeof pluginOptions.input === 'string') {
|
|
33
30
|
return [{ path: pluginOptions.input }];
|
|
34
31
|
}
|
|
35
|
-
throw
|
|
32
|
+
throw createError('Unable to parse html plugin input option');
|
|
36
33
|
}
|
|
37
|
-
exports.normalizeInputOptions = normalizeInputOptions;
|
|
38
34
|
//# sourceMappingURL=normalizeInputOptions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"normalizeInputOptions.js","sourceRoot":"","sources":["../../src/input/normalizeInputOptions.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"normalizeInputOptions.js","sourceRoot":"","sources":["../../src/input/normalizeInputOptions.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C,MAAM,UAAU,qBAAqB,CACnC,aAAsC,EACtC,WAAyB;IAEzB,IAAI,aAAa,CAAC,KAAK,IAAI,IAAI,EAAE;QAC/B,IAAI,WAAW,IAAI,IAAI,EAAE;YACvB,MAAM,WAAW,CAAC,2DAA2D,CAAC,CAAC;SAChF;QAED,IAAI,OAAO,WAAW,KAAK,QAAQ,EAAE;YACnC,OAAO,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC,CAAC;SAChC;QAED,IAAI,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE;YAC9B,OAAO,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;SAC5C;QAED,IAAI,OAAO,WAAW,KAAK,QAAQ,EAAE;YACnC,OAAO,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;SAC5E;QAED,MAAM,WAAW,CAAC,qCAAqC,CAAC,CAAC;KAC1D;IAED,IAAI,KAAK,CAAC,OAAO,CAAC,aAAa,CAAC,KAAK,CAAC,EAAE;QACtC,OAAO,aAAa,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE;YACrC,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;gBAC7B,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;aACxB;YACD,OAAO,KAAK,CAAC;QACf,CAAC,CAAC,CAAC;KACJ;IAED,IAAI,OAAO,aAAa,CAAC,KAAK,KAAK,QAAQ,EAAE;QAC3C,OAAO,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;KAC9B;IAED,IAAI,OAAO,aAAa,CAAC,KAAK,KAAK,QAAQ,EAAE;QAC3C,OAAO,CAAC,EAAE,IAAI,EAAE,aAAa,CAAC,KAAK,EAAE,CAAC,CAAC;KACxC;IAED,MAAM,WAAW,CAAC,0CAA0C,CAAC,CAAC;AAChE,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { GeneratedBundle, RollupPluginHTMLOptions, TransformHtmlFunction } from '../RollupPluginHTMLOptions';
|
|
1
|
+
import { GeneratedBundle, RollupPluginHTMLOptions, TransformHtmlFunction } from '../RollupPluginHTMLOptions.js';
|
|
2
2
|
import { EmittedFile } from 'rollup';
|
|
3
|
-
import { InputData } from '../input/InputData';
|
|
4
|
-
import { EmittedAssets } from './emitAssets';
|
|
3
|
+
import { InputData } from '../input/InputData.js';
|
|
4
|
+
import { EmittedAssets } from './emitAssets.js';
|
|
5
5
|
export interface CreateHTMLAssetParams {
|
|
6
6
|
outputDir: string;
|
|
7
7
|
input: InputData;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createHTMLOutput.d.ts","sourceRoot":"","sources":["../../src/output/createHTMLOutput.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,eAAe,EACf,uBAAuB,EACvB,qBAAqB,EACtB,MAAM,
|
|
1
|
+
{"version":3,"file":"createHTMLOutput.d.ts","sourceRoot":"","sources":["../../src/output/createHTMLOutput.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,eAAe,EACf,uBAAuB,EACvB,qBAAqB,EACtB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AACrC,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD,MAAM,WAAW,qBAAqB;IACpC,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,SAAS,CAAC;IACjB,aAAa,EAAE,aAAa,CAAC;IAC7B,gBAAgB,EAAE,eAAe,EAAE,CAAC;IACpC,wBAAwB,EAAE,qBAAqB,EAAE,CAAC;IAClD,aAAa,EAAE,uBAAuB,CAAC;IACvC,qBAAqB,EAAE,OAAO,CAAC;IAC/B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,mBAAmB,EAAE,OAAO,CAAC;IAC7B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,sBAAsB,EAAE,OAAO,CAAC;CACjC;AAED,wBAAsB,eAAe,CAAC,MAAM,EAAE,qBAAqB,GAAG,OAAO,CAAC,WAAW,CAAC,CA0CzF;AAED,MAAM,WAAW,sBAAsB;IACrC,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,SAAS,EAAE,CAAC;IACpB,aAAa,EAAE,aAAa,CAAC;IAC7B,gBAAgB,EAAE,eAAe,EAAE,CAAC;IACpC,wBAAwB,EAAE,qBAAqB,EAAE,CAAC;IAClD,aAAa,EAAE,uBAAuB,CAAC;IACvC,qBAAqB,EAAE,OAAO,CAAC;IAC/B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,mBAAmB,EAAE,OAAO,CAAC;IAC7B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,sBAAsB,EAAE,OAAO,CAAC;CACjC;AAED,wBAAsB,gBAAgB,CAAC,MAAM,EAAE,sBAAsB,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC,CAE7F"}
|
|
@@ -1,22 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const getOutputHTML_1 = require("./getOutputHTML");
|
|
6
|
-
const utils_1 = require("../utils");
|
|
7
|
-
async function createHTMLAsset(params) {
|
|
1
|
+
import { getEntrypointBundles } from './getEntrypointBundles.js';
|
|
2
|
+
import { getOutputHTML } from './getOutputHTML.js';
|
|
3
|
+
import { createError } from '../utils.js';
|
|
4
|
+
export async function createHTMLAsset(params) {
|
|
8
5
|
const { outputDir, input, emittedAssets, generatedBundles, externalTransformHtmlFns, pluginOptions, defaultInjectDisabled, serviceWorkerPath, injectServiceWorker, absolutePathPrefix, strictCSPInlineScripts, } = params;
|
|
9
6
|
if (generatedBundles.length === 0) {
|
|
10
|
-
throw
|
|
7
|
+
throw createError('Cannot output HTML when no bundles have been generated');
|
|
11
8
|
}
|
|
12
|
-
const entrypointBundles =
|
|
9
|
+
const entrypointBundles = getEntrypointBundles({
|
|
13
10
|
pluginOptions,
|
|
14
11
|
generatedBundles,
|
|
15
12
|
inputModuleIds: input.moduleImports,
|
|
16
13
|
outputDir,
|
|
17
14
|
htmlFileName: input.name,
|
|
18
15
|
});
|
|
19
|
-
const outputHtml = await
|
|
16
|
+
const outputHtml = await getOutputHTML({
|
|
20
17
|
pluginOptions,
|
|
21
18
|
entrypointBundles,
|
|
22
19
|
input,
|
|
@@ -31,9 +28,7 @@ async function createHTMLAsset(params) {
|
|
|
31
28
|
});
|
|
32
29
|
return { fileName: input.name, name: input.name, source: outputHtml, type: 'asset' };
|
|
33
30
|
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
return Promise.all(params.inputs.map(input => createHTMLAsset(Object.assign(Object.assign({}, params), { input }))));
|
|
31
|
+
export async function createHTMLOutput(params) {
|
|
32
|
+
return Promise.all(params.inputs.map(input => createHTMLAsset({ ...params, input })));
|
|
37
33
|
}
|
|
38
|
-
exports.createHTMLOutput = createHTMLOutput;
|
|
39
34
|
//# sourceMappingURL=createHTMLOutput.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createHTMLOutput.js","sourceRoot":"","sources":["../../src/output/createHTMLOutput.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"createHTMLOutput.js","sourceRoot":"","sources":["../../src/output/createHTMLOutput.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAwB1C,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,MAA6B;IACjE,MAAM,EACJ,SAAS,EACT,KAAK,EACL,aAAa,EACb,gBAAgB,EAChB,wBAAwB,EACxB,aAAa,EACb,qBAAqB,EACrB,iBAAiB,EACjB,mBAAmB,EACnB,kBAAkB,EAClB,sBAAsB,GACvB,GAAG,MAAM,CAAC;IAEX,IAAI,gBAAgB,CAAC,MAAM,KAAK,CAAC,EAAE;QACjC,MAAM,WAAW,CAAC,wDAAwD,CAAC,CAAC;KAC7E;IAED,MAAM,iBAAiB,GAAG,oBAAoB,CAAC;QAC7C,aAAa;QACb,gBAAgB;QAChB,cAAc,EAAE,KAAK,CAAC,aAAa;QACnC,SAAS;QACT,YAAY,EAAE,KAAK,CAAC,IAAI;KACzB,CAAC,CAAC;IAEH,MAAM,UAAU,GAAG,MAAM,aAAa,CAAC;QACrC,aAAa;QACb,iBAAiB;QACjB,KAAK;QACL,SAAS;QACT,aAAa;QACb,wBAAwB;QACxB,qBAAqB;QACrB,iBAAiB;QACjB,mBAAmB;QACnB,kBAAkB;QAClB,sBAAsB;KACvB,CAAC,CAAC;IAEH,OAAO,EAAE,QAAQ,EAAE,KAAK,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;AACvF,CAAC;AAgBD,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,MAA8B;IACnE,OAAO,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,eAAe,CAAC,EAAE,GAAG,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC;AACxF,CAAC"}
|
|
@@ -1,11 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.emitAssets = void 0;
|
|
7
|
-
const path_1 = __importDefault(require("path"));
|
|
8
|
-
async function emitAssets(inputs, options) {
|
|
1
|
+
import path from 'path';
|
|
2
|
+
export async function emitAssets(inputs, options) {
|
|
9
3
|
const emittedStaticAssets = new Map();
|
|
10
4
|
const emittedHashedAssets = new Map();
|
|
11
5
|
const emittedStaticAssetNames = new Set();
|
|
@@ -44,7 +38,7 @@ async function emitAssets(inputs, options) {
|
|
|
44
38
|
}
|
|
45
39
|
}
|
|
46
40
|
let ref;
|
|
47
|
-
let basename =
|
|
41
|
+
let basename = path.basename(asset.filePath);
|
|
48
42
|
if (asset.hashed) {
|
|
49
43
|
ref = this.emitFile({ type: 'asset', name: basename, source });
|
|
50
44
|
}
|
|
@@ -52,7 +46,7 @@ async function emitAssets(inputs, options) {
|
|
|
52
46
|
// ensure the output filename is unique
|
|
53
47
|
let i = 1;
|
|
54
48
|
while (emittedStaticAssetNames.has(basename)) {
|
|
55
|
-
const ext =
|
|
49
|
+
const ext = path.extname(basename);
|
|
56
50
|
basename = `${basename.replace(ext, '')}${i}${ext}`;
|
|
57
51
|
i += 1;
|
|
58
52
|
}
|
|
@@ -65,5 +59,4 @@ async function emitAssets(inputs, options) {
|
|
|
65
59
|
}
|
|
66
60
|
return { static: emittedStaticAssets, hashed: emittedHashedAssets };
|
|
67
61
|
}
|
|
68
|
-
exports.emitAssets = emitAssets;
|
|
69
62
|
//# sourceMappingURL=emitAssets.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"emitAssets.js","sourceRoot":"","sources":["../../src/output/emitAssets.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"emitAssets.js","sourceRoot":"","sources":["../../src/output/emitAssets.ts"],"names":[],"mappings":"AACA,OAAO,IAAI,MAAM,MAAM,CAAC;AAUxB,MAAM,CAAC,KAAK,UAAU,UAAU,CAE9B,MAAmB,EACnB,OAAgC;IAEhC,MAAM,mBAAmB,GAAG,IAAI,GAAG,EAAkB,CAAC;IACtD,MAAM,mBAAmB,GAAG,IAAI,GAAG,EAAkB,CAAC;IACtD,MAAM,uBAAuB,GAAG,IAAI,GAAG,EAAE,CAAC;IAE1C,MAAM,UAAU,GAA6B,EAAE,CAAC;IAChD,IAAI,OAAO,CAAC,cAAc,EAAE;QAC1B,IAAI,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,cAAc,CAAC,EAAE;YACzC,UAAU,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;SAC5C;aAAM;YACL,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,cAAc,C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,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,CAAC;aAChE;iBAAM;gBACL,uCAAuC;gBACvC,IAAI,CAAC,GAAG,CAAC,CAAC;gBACV,OAAO,uBAAuB,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE;oBAC5C,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;oBACnC,QAAQ,GAAG,GAAG,QAAQ,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,GAAG,GAAG,EAAE,CAAC;oBACpD,CAAC,IAAI,CAAC,CAAC;iBACR;gBACD,uBAAuB,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;gBACtC,MAAM,QAAQ,GAAG,UAAU,QAAQ,EAAE,CAAC;gBACtC,GAAG,GAAG,IAAI,CAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,CAAC;aAC1E;YAED,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,QAAQ,EAAE,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC;SAChD;KACF;IAED,OAAO,EAAE,MAAM,EAAE,mBAAmB,EAAE,MAAM,EAAE,mBAAmB,EAAE,CAAC;AACtE,CAAC"}
|
|
@@ -1,48 +1,40 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.getEntrypointBundles = exports.createImportPath = void 0;
|
|
7
|
-
const path_1 = __importDefault(require("path"));
|
|
8
|
-
const utils_1 = require("../utils");
|
|
9
|
-
const utils_2 = require("./utils");
|
|
10
|
-
function createImportPath(params) {
|
|
1
|
+
import path from 'path';
|
|
2
|
+
import { createError, NOOP_IMPORT } from '../utils.js';
|
|
3
|
+
import { toBrowserPath } from './utils.js';
|
|
4
|
+
export function createImportPath(params) {
|
|
11
5
|
const { publicPath, outputDir, fileOutputDir, htmlFileName, fileName } = params;
|
|
12
|
-
const pathFromMainToFileDir =
|
|
6
|
+
const pathFromMainToFileDir = path.relative(outputDir, fileOutputDir);
|
|
13
7
|
let importPath;
|
|
14
8
|
if (publicPath) {
|
|
15
|
-
importPath =
|
|
9
|
+
importPath = toBrowserPath(path.join(publicPath, pathFromMainToFileDir, fileName));
|
|
16
10
|
}
|
|
17
11
|
else {
|
|
18
|
-
const pathFromHtmlToOutputDir =
|
|
19
|
-
importPath =
|
|
12
|
+
const pathFromHtmlToOutputDir = path.relative(path.dirname(htmlFileName), pathFromMainToFileDir);
|
|
13
|
+
importPath = toBrowserPath(path.join(pathFromHtmlToOutputDir, fileName));
|
|
20
14
|
}
|
|
21
15
|
if (importPath.startsWith('http') || importPath.startsWith('/') || importPath.startsWith('.')) {
|
|
22
16
|
return importPath;
|
|
23
17
|
}
|
|
24
18
|
return `./${importPath}`;
|
|
25
19
|
}
|
|
26
|
-
|
|
27
|
-
function getEntrypointBundles(params) {
|
|
28
|
-
var _a;
|
|
20
|
+
export function getEntrypointBundles(params) {
|
|
29
21
|
const { pluginOptions, generatedBundles, inputModuleIds, outputDir, htmlFileName } = params;
|
|
30
22
|
const entrypointBundles = {};
|
|
31
23
|
for (const { name, options, bundle } of generatedBundles) {
|
|
32
24
|
if (!options.format) {
|
|
33
|
-
throw
|
|
25
|
+
throw createError('Missing module format');
|
|
34
26
|
}
|
|
35
27
|
const entrypoints = [];
|
|
36
28
|
for (const chunkOrAsset of Object.values(bundle)) {
|
|
37
29
|
if (chunkOrAsset.type === 'chunk') {
|
|
38
30
|
const chunk = chunkOrAsset;
|
|
39
|
-
if (chunk.isEntry && chunk.facadeModuleId !==
|
|
31
|
+
if (chunk.isEntry && chunk.facadeModuleId !== NOOP_IMPORT.importPath) {
|
|
40
32
|
const found = inputModuleIds.find(mod => mod.importPath === chunk.facadeModuleId);
|
|
41
33
|
if (chunk.facadeModuleId && found) {
|
|
42
34
|
const importPath = createImportPath({
|
|
43
35
|
publicPath: pluginOptions.publicPath,
|
|
44
36
|
outputDir,
|
|
45
|
-
fileOutputDir:
|
|
37
|
+
fileOutputDir: options.dir ?? '',
|
|
46
38
|
htmlFileName,
|
|
47
39
|
fileName: chunkOrAsset.fileName,
|
|
48
40
|
});
|
|
@@ -55,5 +47,4 @@ function getEntrypointBundles(params) {
|
|
|
55
47
|
}
|
|
56
48
|
return entrypointBundles;
|
|
57
49
|
}
|
|
58
|
-
exports.getEntrypointBundles = getEntrypointBundles;
|
|
59
50
|
//# sourceMappingURL=getEntrypointBundles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getEntrypointBundles.js","sourceRoot":"","sources":["../../src/output/getEntrypointBundles.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"getEntrypointBundles.js","sourceRoot":"","sources":["../../src/output/getEntrypointBundles.ts"],"names":[],"mappings":"AACA,OAAO,IAAI,MAAM,MAAM,CAAC;AASxB,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAU3C,MAAM,UAAU,gBAAgB,CAAC,MAA8B;IAC7D,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,aAAa,EAAE,YAAY,EAAE,QAAQ,EAAE,GAAG,MAAM,CAAC;IAChF,MAAM,qBAAqB,GAAG,IAAI,CAAC,QAAQ,CAAC,SAAS,EAAE,aAAa,CAAC,CAAC;IACtE,IAAI,UAAU,CAAC;IACf,IAAI,UAAU,EAAE;QACd,UAAU,GAAG,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,qBAAqB,EAAE,QAAQ,CAAC,CAAC,CAAC;KACpF;SAAM;QACL,MAAM,uBAAuB,GAAG,IAAI,CAAC,QAAQ,CAC3C,IAAI,CAAC,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U,EAAE,aAAa,CAAC,UAAU;4BACpC,SAAS;4BACT,aAAa,EAAE,OAAO,CAAC,GAAG,IAAI,EAAE;4BAChC,YAAY;4BACZ,QAAQ,EAAE,YAAY,CAAC,QAAQ;yBAChC,CAAC,CAAC;wBACH,WAAW,CAAC,IAAI,CAAC,EAAE,UAAU,EAAE,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,KAAK,CAAC,UAAU,EAAE,CAAC,CAAC;qBACrF;iBACF;aACF;SACF;QACD,iBAAiB,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,CAAC;KAClE;IAED,OAAO,iBAAiB,CAAC;AAC3B,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { InputData } from '../input/InputData';
|
|
2
2
|
import { EntrypointBundle, RollupPluginHTMLOptions, TransformHtmlFunction } from '../RollupPluginHTMLOptions';
|
|
3
|
-
import { EmittedAssets } from './emitAssets';
|
|
3
|
+
import { EmittedAssets } from './emitAssets.js';
|
|
4
4
|
export interface GetOutputHTMLParams {
|
|
5
5
|
input: InputData;
|
|
6
6
|
outputDir: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getOutputHTML.d.ts","sourceRoot":"","sources":["../../src/output/getOutputHTML.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EACL,gBAAgB,EAChB,uBAAuB,EACvB,qBAAqB,EACtB,MAAM,4BAA4B,CAAC;AAIpC,OAAO,EAAE,aAAa,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"getOutputHTML.d.ts","sourceRoot":"","sources":["../../src/output/getOutputHTML.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EACL,gBAAgB,EAChB,uBAAuB,EACvB,qBAAqB,EACtB,MAAM,4BAA4B,CAAC;AAIpC,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAKhD,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,SAAS,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,aAAa,CAAC;IAC7B,aAAa,EAAE,uBAAuB,CAAC;IACvC,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;IACpD,wBAAwB,CAAC,EAAE,qBAAqB,EAAE,CAAC;IACnD,qBAAqB,EAAE,OAAO,CAAC;IAC/B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,mBAAmB,EAAE,OAAO,CAAC;IAC7B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,sBAAsB,EAAE,OAAO,CAAC;CACjC;AAED,wBAAsB,aAAa,CAAC,MAAM,EAAE,mBAAmB,mBAqF9D"}
|
|
@@ -1,32 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
t[p[i]] = s[p[i]];
|
|
10
|
-
}
|
|
11
|
-
return t;
|
|
12
|
-
};
|
|
13
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
-
exports.getOutputHTML = void 0;
|
|
15
|
-
const injectBundles_1 = require("./injectBundles");
|
|
16
|
-
const parse5_1 = require("parse5");
|
|
17
|
-
const html_minifier_terser_1 = require("html-minifier-terser");
|
|
18
|
-
const injectedUpdatedAssetPaths_1 = require("./injectedUpdatedAssetPaths");
|
|
19
|
-
const injectAbsoluteBaseUrl_1 = require("./injectAbsoluteBaseUrl");
|
|
20
|
-
const hashInlineScripts_1 = require("./hashInlineScripts");
|
|
21
|
-
const injectServiceWorkerRegistration_1 = require("./injectServiceWorkerRegistration");
|
|
22
|
-
async function getOutputHTML(params) {
|
|
1
|
+
import { injectBundles } from './injectBundles.js';
|
|
2
|
+
import { parse, serialize } from 'parse5';
|
|
3
|
+
import { minify as minifyHTMLFunc } from 'html-minifier-terser';
|
|
4
|
+
import { injectedUpdatedAssetPaths } from './injectedUpdatedAssetPaths.js';
|
|
5
|
+
import { injectAbsoluteBaseUrl } from './injectAbsoluteBaseUrl.js';
|
|
6
|
+
import { hashInlineScripts } from './hashInlineScripts.js';
|
|
7
|
+
import { injectServiceWorkerRegistration } from './injectServiceWorkerRegistration.js';
|
|
8
|
+
export async function getOutputHTML(params) {
|
|
23
9
|
const { pluginOptions, entrypointBundles, externalTransformHtmlFns, input, outputDir, emittedAssets, defaultInjectDisabled, serviceWorkerPath, injectServiceWorker, absolutePathPrefix, strictCSPInlineScripts, } = params;
|
|
24
|
-
const { default: defaultBundle
|
|
10
|
+
const { default: defaultBundle, ...multiBundles } = entrypointBundles;
|
|
25
11
|
const { absoluteSocialMediaUrls = true, rootDir = process.cwd() } = pluginOptions;
|
|
26
12
|
// inject rollup output into HTML
|
|
27
|
-
let document =
|
|
13
|
+
let document = parse(input.html);
|
|
28
14
|
if (pluginOptions.extractAssets !== false) {
|
|
29
|
-
|
|
15
|
+
injectedUpdatedAssetPaths({
|
|
30
16
|
document,
|
|
31
17
|
input,
|
|
32
18
|
outputDir,
|
|
@@ -37,21 +23,21 @@ async function getOutputHTML(params) {
|
|
|
37
23
|
});
|
|
38
24
|
}
|
|
39
25
|
if (!defaultInjectDisabled) {
|
|
40
|
-
|
|
26
|
+
injectBundles(document, entrypointBundles);
|
|
41
27
|
}
|
|
42
28
|
if (absoluteSocialMediaUrls && pluginOptions.absoluteBaseUrl) {
|
|
43
|
-
|
|
29
|
+
injectAbsoluteBaseUrl(document, pluginOptions.absoluteBaseUrl);
|
|
44
30
|
}
|
|
45
31
|
if (injectServiceWorker && serviceWorkerPath) {
|
|
46
|
-
|
|
32
|
+
injectServiceWorkerRegistration({
|
|
47
33
|
document,
|
|
48
34
|
outputDir,
|
|
49
35
|
serviceWorkerPath,
|
|
50
36
|
htmlFileName: input.name,
|
|
51
37
|
});
|
|
52
38
|
}
|
|
53
|
-
let outputHtml =
|
|
54
|
-
const transforms = [...(externalTransformHtmlFns
|
|
39
|
+
let outputHtml = serialize(document);
|
|
40
|
+
const transforms = [...(externalTransformHtmlFns ?? [])];
|
|
55
41
|
if (pluginOptions.transformHtml) {
|
|
56
42
|
if (Array.isArray(pluginOptions.transformHtml)) {
|
|
57
43
|
transforms.push(...pluginOptions.transformHtml);
|
|
@@ -69,7 +55,7 @@ async function getOutputHTML(params) {
|
|
|
69
55
|
});
|
|
70
56
|
}
|
|
71
57
|
if (pluginOptions.minify) {
|
|
72
|
-
outputHtml = await
|
|
58
|
+
outputHtml = await minifyHTMLFunc(outputHtml, {
|
|
73
59
|
collapseWhitespace: true,
|
|
74
60
|
removeComments: true,
|
|
75
61
|
removeRedundantAttributes: true,
|
|
@@ -81,11 +67,10 @@ async function getOutputHTML(params) {
|
|
|
81
67
|
});
|
|
82
68
|
}
|
|
83
69
|
if (strictCSPInlineScripts) {
|
|
84
|
-
document =
|
|
85
|
-
|
|
86
|
-
outputHtml =
|
|
70
|
+
document = parse(outputHtml);
|
|
71
|
+
hashInlineScripts(document);
|
|
72
|
+
outputHtml = serialize(document);
|
|
87
73
|
}
|
|
88
74
|
return outputHtml;
|
|
89
75
|
}
|
|
90
|
-
exports.getOutputHTML = getOutputHTML;
|
|
91
76
|
//# sourceMappingURL=getOutputHTML.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getOutputHTML.js","sourceRoot":"","sources":["../../src/output/getOutputHTML.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"getOutputHTML.js","sourceRoot":"","sources":["../../src/output/getOutputHTML.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAOnD,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAC1C,OAAO,EAAE,MAAM,IAAI,cAAc,EAAE,MAAM,sBAAsB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
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.hashInlineScripts = void 0;
|
|
7
|
-
const parse5_utils_1 = require("@web/parse5-utils");
|
|
8
|
-
const crypto_1 = __importDefault(require("crypto"));
|
|
1
|
+
import { findElement, findElements, getTagName, hasAttribute, getAttribute, getTextContent, createElement, findNode, prepend, setAttribute, } from '@web/parse5-utils';
|
|
2
|
+
import crypto from 'crypto';
|
|
9
3
|
function isMetaCSPTag(node) {
|
|
10
|
-
if (
|
|
11
|
-
|
|
4
|
+
if (getTagName(node) === 'meta' &&
|
|
5
|
+
getAttribute(node, 'http-equiv') === 'Content-Security-Policy') {
|
|
12
6
|
return true;
|
|
13
7
|
}
|
|
14
8
|
return false;
|
|
15
9
|
}
|
|
16
10
|
function isInlineScript(node) {
|
|
17
|
-
if (
|
|
11
|
+
if (getTagName(node) === 'script' && !hasAttribute(node, 'src')) {
|
|
18
12
|
return true;
|
|
19
13
|
}
|
|
20
14
|
return false;
|
|
@@ -43,7 +37,10 @@ function parseMetaCSPContent(content) {
|
|
|
43
37
|
}
|
|
44
38
|
const splitItem = trimmed.split(' ');
|
|
45
39
|
const [, ...values] = splitItem;
|
|
46
|
-
return
|
|
40
|
+
return {
|
|
41
|
+
...acc,
|
|
42
|
+
[splitItem[0]]: values,
|
|
43
|
+
};
|
|
47
44
|
}, {});
|
|
48
45
|
}
|
|
49
46
|
/**
|
|
@@ -84,7 +81,7 @@ function serializeMetaCSPContent(data) {
|
|
|
84
81
|
}, '');
|
|
85
82
|
}
|
|
86
83
|
function injectCSPScriptRules(metaCSPEl, hashes) {
|
|
87
|
-
const content =
|
|
84
|
+
const content = getAttribute(metaCSPEl, 'content');
|
|
88
85
|
if (content) {
|
|
89
86
|
const data = parseMetaCSPContent(content);
|
|
90
87
|
if (Array.isArray(data['script-src'])) {
|
|
@@ -94,27 +91,27 @@ function injectCSPScriptRules(metaCSPEl, hashes) {
|
|
|
94
91
|
data['script-src'] = ["'self'", ...hashes];
|
|
95
92
|
}
|
|
96
93
|
const newContent = serializeMetaCSPContent(data);
|
|
97
|
-
|
|
94
|
+
setAttribute(metaCSPEl, 'content', newContent);
|
|
98
95
|
}
|
|
99
96
|
}
|
|
100
97
|
function injectCSPMetaTag(document, hashes) {
|
|
101
|
-
const metaTag =
|
|
98
|
+
const metaTag = createElement('meta', {
|
|
102
99
|
'http-equiv': 'Content-Security-Policy',
|
|
103
100
|
content: `script-src 'self' ${hashes.join(' ')};`,
|
|
104
101
|
});
|
|
105
|
-
const head =
|
|
102
|
+
const head = findNode(document, node => node.nodeName === 'head');
|
|
106
103
|
if (head) {
|
|
107
|
-
|
|
104
|
+
prepend(head, metaTag);
|
|
108
105
|
}
|
|
109
106
|
}
|
|
110
|
-
function hashInlineScripts(document) {
|
|
111
|
-
const metaCSPEl =
|
|
112
|
-
const inlineScripts =
|
|
107
|
+
export function hashInlineScripts(document) {
|
|
108
|
+
const metaCSPEl = findElement(document, isMetaCSPTag);
|
|
109
|
+
const inlineScripts = findElements(document, isInlineScript);
|
|
113
110
|
const hashes = [];
|
|
114
111
|
inlineScripts.forEach(node => {
|
|
115
112
|
if (node.childNodes[0]) {
|
|
116
|
-
const scriptContent =
|
|
117
|
-
const hash =
|
|
113
|
+
const scriptContent = getTextContent(node.childNodes[0]);
|
|
114
|
+
const hash = crypto.createHash('sha256').update(scriptContent).digest('base64');
|
|
118
115
|
hashes.push(`'sha256-${hash}'`);
|
|
119
116
|
}
|
|
120
117
|
});
|
|
@@ -127,5 +124,4 @@ function hashInlineScripts(document) {
|
|
|
127
124
|
}
|
|
128
125
|
}
|
|
129
126
|
}
|
|
130
|
-
exports.hashInlineScripts = hashInlineScripts;
|
|
131
127
|
//# sourceMappingURL=hashInlineScripts.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hashInlineScripts.js","sourceRoot":"","sources":["../../src/output/hashInlineScripts.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"hashInlineScripts.js","sourceRoot":"","sources":["../../src/output/hashInlineScripts.ts"],"names":[],"mappings":"AACA,OAAO,EACL,WAAW,EACX,YAAY,EACZ,UAAU,EACV,YAAY,EACZ,YAAY,EACZ,cAAc,EACd,aAAa,EACb,QAAQ,EACR,OAAO,EACP,YAAY,GACb,MAAM,mBAAmB,CAAC;AAC3B,OAAO,MAAM,MAAM,QAAQ,CAAC;AAE5B,SAAS,YAAY,CAAC,IAAa;IACjC,IACE,UAAU,CAAC,IAAI,CAAC,KAAK,MAAM;QAC3B,YAAY,CAAC,IAAI,EAAE,YAAY,CAAC,KAAK,yBAAyB,EAC9D;QACA,OAAO,IAAI,CAAC;KACb;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,SAAS,cAAc,CAAC,IAAa;IACnC,IAAI,UAAU,CAAC,IAAI,CAAC,KAAK,QAAQ,IAAI,CAAC,YAAY,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE;QAC/D,OAAO,IAAI,CAAC;KACb;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;;;;;;;;;;;;;;GAeG;AACH,SAAS,mBAAmB,CAAC,OAAe;IAC1C,OAAO,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE;QAC7C,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC;QAC5B,IAAI,CAAC,OAAO,EAAE;YACZ,OAAO,GAAG,CAAC;SACZ;QACD,MAAM,SAAS,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACrC,MAAM,CAAC,EAAE,GAAG,MAAM,CAAC,GAAG,SAAS,CAAC;QAChC,OAAO;YACL,GAAG,GAAG;YACN,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,EAAE,MAAM;SACvB,CAAC;IACJ,CAAC,EAAE,EAAE,CAAC,CAAC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