@web/rollup-plugin-html 2.0.1 → 2.1.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/dist/assets/utils.js +2 -2
- 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 -3
- package/dist/index.js.map +1 -1
- package/dist/input/addRollupInput.d.ts +1 -1
- package/dist/input/addRollupInput.d.ts.map +1 -1
- package/dist/input/addRollupInput.js +2 -2
- 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 +5 -5
- 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 +2 -2
- package/dist/input/extract/extractModules.js.map +1 -1
- package/dist/input/extract/extractModulesAndAssets.d.ts +3 -3
- package/dist/input/extract/extractModulesAndAssets.js +4 -4
- 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 +9 -9
- 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 +4 -4
- 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 +6 -6
- package/dist/output/createHTMLOutput.js.map +1 -1
- package/dist/output/getEntrypointBundles.js +6 -6
- 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 +10 -10
- package/dist/output/getOutputHTML.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 +2 -2
- package/dist/output/injectBundles.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 +10 -10
- package/dist/output/injectedUpdatedAssetPaths.js.map +1 -1
- package/dist/rollupPluginHTML.d.ts +2 -2
- package/dist/rollupPluginHTML.d.ts.map +1 -1
- package/dist/rollupPluginHTML.js +19 -19
- package/dist/rollupPluginHTML.js.map +1 -1
- package/dist/utils.d.ts +1 -1
- package/dist/utils.d.ts.map +1 -1
- package/package.json +4 -4
- 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
package/dist/assets/utils.js
CHANGED
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.findAssets = exports.getSourcePaths = exports.getSourceAttribute = exports.resolveAssetFilePath = exports.isHashedAsset = void 0;
|
|
7
7
|
const path_1 = __importDefault(require("path"));
|
|
8
8
|
const parse5_utils_1 = require("@web/parse5-utils");
|
|
9
|
-
const
|
|
9
|
+
const utils_js_1 = require("../utils.js");
|
|
10
10
|
const v8_1 = require("v8");
|
|
11
11
|
const hashedLinkRels = ['stylesheet'];
|
|
12
12
|
const linkRels = [...hashedLinkRels, 'icon', 'manifest', 'apple-touch-icon', 'mask-icon'];
|
|
@@ -122,7 +122,7 @@ function getSourcePaths(node) {
|
|
|
122
122
|
const key = getSourceAttribute(node);
|
|
123
123
|
const src = (0, parse5_utils_1.getAttribute)(node, key);
|
|
124
124
|
if (typeof key !== 'string' || src === '') {
|
|
125
|
-
throw (0,
|
|
125
|
+
throw (0, utils_js_1.createError)(`Missing attribute ${key} in element ${(0, v8_1.serialize)(node)}`);
|
|
126
126
|
}
|
|
127
127
|
let paths = [];
|
|
128
128
|
if (src) {
|
package/dist/assets/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/assets/utils.ts"],"names":[],"mappings":";;;;;;AACA,gDAAwB;AACxB,oDAA2E;AAC3E,
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/assets/utils.ts"],"names":[],"mappings":";;;;;;AACA,gDAAwB;AACxB,oDAA2E;AAC3E,0CAA0C;AAC1C,2BAA+B;AAE/B,MAAM,cAAc,GAAG,CAAC,YAAY,CAAC,CAAC;AACtC,MAAM,QAAQ,GAAG,CAAC,GAAG,cAAc,EAAE,MAAM,EAAE,UAAU,EAAE,kBAAkB,EAAE,WAAW,CAAC,CAAC;AAE1F,SAAS,aAAa,CAAC,MAAc;IACnC,IAAI,CAAC,MAAM,EAAE;QACX,OAAO,EAAE,CAAC;KACX;IACD,MAAM,WAAW,GAAG,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;IACxE,MAAM,IAAI,GAAG,WAAW;SACrB,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC;SACtB,GAAG,CAAC,GAAG,CAAC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W,EAAC,qBAAqB,GAAG,eAAe,IAAA,cAAS,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC;KAC7E;IAED,IAAI,KAAK,GAAa,EAAE,CAAC;IACzB,IAAI,GAAG,EAAE;QACP,KAAK,GAAG,GAAG,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;KACvD;IAED,OAAO,KAAK,CAAC;AACf,CAAC;AAdD,wCAcC;AAED,SAAgB,UAAU,CAAC,QAAkB;IAC3C,OAAO,IAAA,2BAAY,EAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;AACzC,CAAC;AAFD,gCAEC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { rollupPluginHTML, RollupPluginHtml } from './rollupPluginHTML';
|
|
2
|
-
export { InputHTMLOptions, RollupPluginHTMLOptions, GeneratedBundle, EntrypointBundle, TransformHtmlArgs, TransformHtmlFunction, TransformAssetFunction, } from './RollupPluginHTMLOptions';
|
|
1
|
+
import { rollupPluginHTML, RollupPluginHtml } from './rollupPluginHTML.js';
|
|
2
|
+
export { InputHTMLOptions, RollupPluginHTMLOptions, GeneratedBundle, EntrypointBundle, TransformHtmlArgs, TransformHtmlFunction, TransformAssetFunction, } from './RollupPluginHTMLOptions.js';
|
|
3
3
|
export { rollupPluginHTML, RollupPluginHtml };
|
|
4
4
|
export default rollupPluginHTML;
|
|
5
5
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAE3E,OAAO,EACL,gBAAgB,EAChB,uBAAuB,EACvB,eAAe,EACf,gBAAgB,EAChB,iBAAiB,EACjB,qBAAqB,EACrB,sBAAsB,GACvB,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,CAAC;AAC9C,eAAe,gBAAgB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.rollupPluginHTML = void 0;
|
|
4
|
-
const
|
|
5
|
-
Object.defineProperty(exports, "rollupPluginHTML", { enumerable: true, get: function () { return
|
|
6
|
-
exports.default =
|
|
4
|
+
const rollupPluginHTML_js_1 = require("./rollupPluginHTML.js");
|
|
5
|
+
Object.defineProperty(exports, "rollupPluginHTML", { enumerable: true, get: function () { return rollupPluginHTML_js_1.rollupPluginHTML; } });
|
|
6
|
+
exports.default = rollupPluginHTML_js_1.rollupPluginHTML;
|
|
7
7
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,+DAA2E;AAYlE,iGAZA,sCAAgB,OAYA;AACzB,kBAAe,sCAAgB,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { InputOptions } from 'rollup';
|
|
2
|
-
import { ScriptModuleTag } from '../RollupPluginHTMLOptions';
|
|
2
|
+
import { ScriptModuleTag } from '../RollupPluginHTMLOptions.js';
|
|
3
3
|
export declare function addRollupInput(inputOptions: InputOptions, inputModuleIds: ScriptModuleTag[]): InputOptions;
|
|
4
4
|
//# sourceMappingURL=addRollupInput.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"addRollupInput.d.ts","sourceRoot":"","sources":["../../src/input/addRollupInput.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,EAAE,eAAe,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"addRollupInput.d.ts","sourceRoot":"","sources":["../../src/input/addRollupInput.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAWhE,wBAAgB,cAAc,CAC5B,YAAY,EAAE,YAAY,EAC1B,cAAc,EAAE,eAAe,EAAE,GAChC,YAAY,CAuCd"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.addRollupInput = void 0;
|
|
4
|
-
const
|
|
4
|
+
const utils_js_1 = require("../utils.js");
|
|
5
5
|
function fromEntries(entries) {
|
|
6
6
|
const obj = {};
|
|
7
7
|
for (const [k, v] of entries) {
|
|
@@ -30,7 +30,7 @@ function addRollupInput(inputOptions, inputModuleIds) {
|
|
|
30
30
|
.map(mod => mod.importPath)
|
|
31
31
|
.map(i => [i.split('/').slice(-1)[0].split('.')[0], i]))) });
|
|
32
32
|
}
|
|
33
|
-
throw (0,
|
|
33
|
+
throw (0, utils_js_1.createError)(`Unknown rollup input type. Supported inputs are string, array and object.`);
|
|
34
34
|
}
|
|
35
35
|
exports.addRollupInput = addRollupInput;
|
|
36
36
|
//# sourceMappingURL=addRollupInput.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"addRollupInput.js","sourceRoot":"","sources":["../../src/input/addRollupInput.ts"],"names":[],"mappings":";;;AAEA,
|
|
1
|
+
{"version":3,"file":"addRollupInput.js","sourceRoot":"","sources":["../../src/input/addRollupInput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AAW,CACZ,cAAc;iBACX,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,UAAU,CAAC;iBAC1B,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAC1D,KAEH;KACH;IAED,MAAM,IAAA,sBAAW,EAAC,2EAA2E,CAAC,CAAC;AACjG,CAAC;AA1CD,wCA0CC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extractAssets.d.ts","sourceRoot":"","sources":["../../../src/input/extract/extractAssets.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAa,MAAM,QAAQ,CAAC;AAG7C,OAAO,EAAE,UAAU,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"extractAssets.d.ts","sourceRoot":"","sources":["../../../src/input/extract/extractAssets.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAa,MAAM,QAAQ,CAAC;AAG7C,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAQ7C,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,QAAQ,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,wBAAgB,aAAa,CAAC,MAAM,EAAE,mBAAmB,GAAG,UAAU,EAAE,CAiCvE"}
|
|
@@ -7,15 +7,15 @@ exports.extractAssets = void 0;
|
|
|
7
7
|
const parse5_1 = require("parse5");
|
|
8
8
|
const fs_1 = __importDefault(require("fs"));
|
|
9
9
|
const path_1 = __importDefault(require("path"));
|
|
10
|
-
const
|
|
10
|
+
const utils_js_1 = require("../../assets/utils.js");
|
|
11
11
|
function extractAssets(params) {
|
|
12
|
-
const assetNodes = (0,
|
|
12
|
+
const assetNodes = (0, utils_js_1.findAssets)(params.document);
|
|
13
13
|
const allAssets = [];
|
|
14
14
|
for (const node of assetNodes) {
|
|
15
|
-
const sourcePaths = (0,
|
|
15
|
+
const sourcePaths = (0, utils_js_1.getSourcePaths)(node);
|
|
16
16
|
for (const sourcePath of sourcePaths) {
|
|
17
|
-
const filePath = (0,
|
|
18
|
-
const hashed = (0,
|
|
17
|
+
const filePath = (0, utils_js_1.resolveAssetFilePath)(sourcePath, params.htmlDir, params.rootDir, params.absolutePathPrefix);
|
|
18
|
+
const hashed = (0, utils_js_1.isHashedAsset)(node);
|
|
19
19
|
const alreadyHandled = allAssets.find(a => a.filePath === filePath && a.hashed === hashed);
|
|
20
20
|
if (!alreadyHandled) {
|
|
21
21
|
try {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extractAssets.js","sourceRoot":"","sources":["../../../src/input/extract/extractAssets.ts"],"names":[],"mappings":";;;;;;AAAA,mCAA6C;AAC7C,4CAAoB;AACpB,gDAAwB;AAExB,
|
|
1
|
+
{"version":3,"file":"extractAssets.js","sourceRoot":"","sources":["../../../src/input/extract/extractAssets.ts"],"names":[],"mappings":";;;;;;AAAA,mCAA6C;AAC7C,4CAAoB;AACpB,gDAAwB;AAExB,oDAK+B;AAU/B,SAAgB,aAAa,CAAC,MAA2B;IACvD,MAAM,UAAU,GAAG,IAAA,qBAAU,EAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;IAC/C,MAAM,SAAS,GAAiB,EAAE,CAAC;IAEnC,KAAK,MAAM,IAAI,IAAI,UAAU,EAAE;QAC7B,MAAM,WAAW,GAAG,IAAA,yBAAc,EAAC,IAAI,CAAC,CAAC;QACzC,KAAK,MAAM,UAAU,IAAI,WAAW,EAAE;YACpC,MAAM,QAAQ,GAAG,IAAA,+BAAoB,EACnC,UAAU,EACV,MAAM,CAAC,OAAO,EACd,MAAM,CAAC,OAAO,EACd,MAAM,CAAC,kBAAkB,CAC1B,CAAC;YACF,MAAM,MAAM,GAAG,IAAA,wBAAa,EAAC,IAAI,CAAC,CAAC;YACnC,MAAM,cAAc,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,KAAK,QAAQ,IAAI,CAAC,CAAC,MAAM,KAAK,MAAM,CAAC,CAAC;YAC3F,IAAI,CAAC,cAAc,EAAE;gBACnB,IAAI;oBACF,YAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;iBACzB;gBAAC,OAAO,KAAK,EAAE;oBACd,MAAM,KAAK,GAAG,IAAA,kBAAS,EAAC,IAAI,CAAC,CAAC;oBAC9B,MAAM,QAAQ,GAAG,cAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,MAAM,CAAC,YAAY,CAAC,CAAC;oBACnE,MAAM,IAAI,KAAK,CACb,kBAAkB,QAAQ,8BAA8B,QAAQ,iBAAiB,KAAK,GAAG,CAC1F,CAAC;iBACH;gBAED,MAAM,OAAO,GAAG,YAAE,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;gBAC1C,SAAS,CAAC,IAAI,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,CAAC;aAC/C;SACF;KACF;IAED,OAAO,SAAS,CAAC;AACnB,CAAC;AAjCD,sCAiCC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extractModules.d.ts","sourceRoot":"","sources":["../../../src/input/extract/extractModules.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAa,MAAM,QAAQ,CAAC;AAK7C,OAAO,EAAE,eAAe,EAAE,MAAM
|
|
1
|
+
{"version":3,"file":"extractModules.d.ts","sourceRoot":"","sources":["../../../src/input/extract/extractModules.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAa,MAAM,QAAQ,CAAC;AAK7C,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAEnE,MAAM,WAAW,oBAAoB;IACnC,QAAQ,EAAE,QAAQ,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAeD,wBAAgB,cAAc,CAAC,MAAM,EAAE,oBAAoB;;;EAiD1D"}
|
|
@@ -7,7 +7,7 @@ exports.extractModules = void 0;
|
|
|
7
7
|
const parse5_utils_1 = require("@web/parse5-utils");
|
|
8
8
|
const path_1 = __importDefault(require("path"));
|
|
9
9
|
const crypto_1 = __importDefault(require("crypto"));
|
|
10
|
-
const
|
|
10
|
+
const utils_js_1 = require("../../assets/utils.js");
|
|
11
11
|
const parse5_utils_2 = require("@web/parse5-utils");
|
|
12
12
|
function createContentHash(content) {
|
|
13
13
|
return crypto_1.default.createHash('md5').update(content).digest('hex');
|
|
@@ -53,7 +53,7 @@ function extractModules(params) {
|
|
|
53
53
|
else {
|
|
54
54
|
if (!isAbsolute(src)) {
|
|
55
55
|
// external script <script type="module" src="./foo.js"></script>
|
|
56
|
-
const importPath = (0,
|
|
56
|
+
const importPath = (0, utils_js_1.resolveAssetFilePath)(src, htmlDir, rootDir, absolutePathPrefix);
|
|
57
57
|
moduleImports.push({
|
|
58
58
|
importPath,
|
|
59
59
|
attributes,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extractModules.js","sourceRoot":"","sources":["../../../src/input/extract/extractModules.ts"],"names":[],"mappings":";;;;;;AAAA,oDAAmG;AAEnG,gDAAwB;AACxB,oDAA4B;AAC5B,
|
|
1
|
+
{"version":3,"file":"extractModules.js","sourceRoot":"","sources":["../../../src/input/extract/extractModules.ts"],"names":[],"mappings":";;;;;;AAAA,oDAAmG;AAEnG,gDAAwB;AACxB,oDAA4B;AAC5B,oDAA6D;AAC7D,oDAAkD;AAUlD,SAAS,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M,IAAI,GAAG,IAAA,6BAAc,EAAC,UAAU,CAAC,CAAC;YACxC,iFAAiF;YACjF,oFAAoF;YACpF,MAAM,UAAU,GAAG,cAAI,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,kBAAkB,iBAAiB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YAC5F,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,UAAU,KAAK,UAAU,CAAC,EAAE;gBAC7D,aAAa,CAAC,IAAI,CAAC;oBACjB,UAAU;oBACV,UAAU;oBACV,IAAI;iBACL,CAAC,CAAC;aACJ;YACD,IAAA,qBAAM,EAAC,UAAU,CAAC,CAAC;SACpB;aAAM;YACL,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE;gBACpB,iEAAiE;gBACjE,MAAM,UAAU,GAAG,IAAA,+BAAoB,EAAC,GAAG,EAAE,OAAO,EAAE,OAAO,EAAE,kBAAkB,CAAC,CAAC;gBACnF,aAAa,CAAC,IAAI,CAAC;oBACjB,UAAU;oBACV,UAAU;iBACX,CAAC,CAAC;gBACH,IAAA,qBAAM,EAAC,UAAU,CAAC,CAAC;aACpB;SACF;KACF;IAED,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,CAAC;AAC1C,CAAC;AAjDD,wCAiDC"}
|
|
@@ -6,9 +6,9 @@ export interface ExtractParams {
|
|
|
6
6
|
absolutePathPrefix?: string;
|
|
7
7
|
}
|
|
8
8
|
export declare function extractModulesAndAssets(params: ExtractParams): {
|
|
9
|
-
moduleImports: import("../../RollupPluginHTMLOptions").ScriptModuleTag[];
|
|
10
|
-
inlineModules: import("../../RollupPluginHTMLOptions").ScriptModuleTag[];
|
|
11
|
-
assets: import("../InputData").InputAsset[];
|
|
9
|
+
moduleImports: import("../../RollupPluginHTMLOptions.js").ScriptModuleTag[];
|
|
10
|
+
inlineModules: import("../../RollupPluginHTMLOptions.js").ScriptModuleTag[];
|
|
11
|
+
assets: import("../InputData.js").InputAsset[];
|
|
12
12
|
htmlWithoutModules: string;
|
|
13
13
|
};
|
|
14
14
|
//# sourceMappingURL=extractModulesAndAssets.d.ts.map
|
|
@@ -6,21 +6,21 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.extractModulesAndAssets = void 0;
|
|
7
7
|
const path_1 = __importDefault(require("path"));
|
|
8
8
|
const parse5_1 = require("parse5");
|
|
9
|
-
const
|
|
10
|
-
const
|
|
9
|
+
const extractModules_js_1 = require("./extractModules.js");
|
|
10
|
+
const extractAssets_js_1 = require("./extractAssets.js");
|
|
11
11
|
function extractModulesAndAssets(params) {
|
|
12
12
|
const { html, htmlFilePath, rootDir, absolutePathPrefix } = params;
|
|
13
13
|
const htmlDir = path_1.default.dirname(htmlFilePath);
|
|
14
14
|
const document = (0, parse5_1.parse)(html);
|
|
15
15
|
// extract functions mutate the AST
|
|
16
|
-
const { moduleImports, inlineModules } = (0,
|
|
16
|
+
const { moduleImports, inlineModules } = (0, extractModules_js_1.extractModules)({
|
|
17
17
|
document,
|
|
18
18
|
htmlDir,
|
|
19
19
|
rootDir,
|
|
20
20
|
absolutePathPrefix,
|
|
21
21
|
});
|
|
22
22
|
const assets = params.extractAssets
|
|
23
|
-
? (0,
|
|
23
|
+
? (0, extractAssets_js_1.extractAssets)({ document, htmlDir, htmlFilePath, rootDir, absolutePathPrefix })
|
|
24
24
|
: [];
|
|
25
25
|
// turn mutated AST back to a string
|
|
26
26
|
const updatedHtmlString = (0, parse5_1.serialize)(document);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extractModulesAndAssets.js","sourceRoot":"","sources":["../../../src/input/extract/extractModulesAndAssets.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AACxB,mCAA0C;AAC1C,
|
|
1
|
+
{"version":3,"file":"extractModulesAndAssets.js","sourceRoot":"","sources":["../../../src/input/extract/extractModulesAndAssets.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AACxB,mCAA0C;AAC1C,2DAAqD;AACrD,yDAAmD;AAUnD,SAAgB,uBAAuB,CAAC,MAAqB;IAC3D,MAAM,EAAE,IAAI,EAAE,YAAY,EAAE,OAAO,EAAE,kBAAkB,EAAE,GAAG,MAAM,CAAC;IACnE,MAAM,OAAO,GAAG,cAAI,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;IAC3C,MAAM,QAAQ,GAAG,IAAA,cAAK,EAAC,IAAI,CAAC,CAAC;IAE7B,mCAAmC;IACnC,MAAM,EAAE,aAAa,EAAE,aAAa,EAAE,GAAG,IAAA,kCAAc,EAAC;QACtD,QAAQ;QACR,OAAO;QACP,OAAO;QACP,kBAAkB;KACnB,CAAC,CAAC;IACH,MAAM,MAAM,GAAG,MAAM,CAAC,aAAa;QACjC,CAAC,CAAC,IAAA,gCAAa,EAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,kBAAkB,EAAE,CAAC;QACjF,CAAC,CAAC,EAAE,CAAC;IAEP,oCAAoC;IACpC,MAAM,iBAAiB,GAAG,IAAA,kBAAS,EAAC,QAAQ,CAAC,CAAC;IAE9C,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,CAAC;AACzF,CAAC;AApBD,0DAoBC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { RollupPluginHTMLOptions } from '../RollupPluginHTMLOptions';
|
|
2
|
-
import { InputData } from './InputData';
|
|
1
|
+
import { RollupPluginHTMLOptions } from '../RollupPluginHTMLOptions.js';
|
|
2
|
+
import { InputData } from './InputData.js';
|
|
3
3
|
import { InputOption } from 'rollup';
|
|
4
4
|
export interface CreateInputDataParams {
|
|
5
5
|
name: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getInputData.d.ts","sourceRoot":"","sources":["../../src/input/getInputData.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,uBAAuB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"getInputData.d.ts","sourceRoot":"","sources":["../../src/input/getInputData.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAC;AACxE,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAG3C,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAkBrC,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,OAAO,CAAC;IACvB,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAuBD,wBAAgB,YAAY,CAC1B,aAAa,EAAE,uBAAuB,EACtC,WAAW,CAAC,EAAE,WAAW,GACxB,SAAS,EAAE,CA2Db"}
|
|
@@ -6,12 +6,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.getInputData = void 0;
|
|
7
7
|
const fs_1 = __importDefault(require("fs"));
|
|
8
8
|
const path_1 = __importDefault(require("path"));
|
|
9
|
-
const glob_1 =
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
const
|
|
9
|
+
const glob_1 = require("glob");
|
|
10
|
+
const utils_js_1 = require("../utils.js");
|
|
11
|
+
const normalizeInputOptions_js_1 = require("./normalizeInputOptions.js");
|
|
12
|
+
const extractModulesAndAssets_js_1 = require("./extract/extractModulesAndAssets.js");
|
|
13
13
|
function resolveGlob(fromGlob, opts) {
|
|
14
|
-
const files = glob_1.
|
|
14
|
+
const files = (0, glob_1.globSync)(fromGlob, Object.assign(Object.assign({}, opts), { absolute: true }));
|
|
15
15
|
return (files
|
|
16
16
|
// filter out directories
|
|
17
17
|
.filter(filePath => !fs_1.default.lstatSync(filePath).isDirectory()));
|
|
@@ -25,7 +25,7 @@ function getName(filePath, rootDir, flattenOutput = true) {
|
|
|
25
25
|
function createInputData(params) {
|
|
26
26
|
const { name, html, rootDir, filePath, extractAssets, absolutePathPrefix } = params;
|
|
27
27
|
const htmlFilePath = filePath ? filePath : path_1.default.resolve(rootDir, name);
|
|
28
|
-
const result = (0,
|
|
28
|
+
const result = (0, extractModulesAndAssets_js_1.extractModulesAndAssets)({
|
|
29
29
|
html,
|
|
30
30
|
htmlFilePath,
|
|
31
31
|
rootDir,
|
|
@@ -44,7 +44,7 @@ function createInputData(params) {
|
|
|
44
44
|
function getInputData(pluginOptions, rollupInput) {
|
|
45
45
|
var _a, _b;
|
|
46
46
|
const { rootDir = process.cwd(), flattenOutput, extractAssets = true, absolutePathPrefix, exclude: ignore, } = pluginOptions;
|
|
47
|
-
const allInputs = (0,
|
|
47
|
+
const allInputs = (0, normalizeInputOptions_js_1.normalizeInputOptions)(pluginOptions, rollupInput);
|
|
48
48
|
const result = [];
|
|
49
49
|
for (const input of allInputs) {
|
|
50
50
|
if (typeof input.html === 'string') {
|
|
@@ -78,12 +78,12 @@ function getInputData(pluginOptions, rollupInput) {
|
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
80
|
else {
|
|
81
|
-
throw (0,
|
|
81
|
+
throw (0, utils_js_1.createError)('An input must specify either a path or html.');
|
|
82
82
|
}
|
|
83
83
|
}
|
|
84
84
|
for (const input of result) {
|
|
85
85
|
if (result.filter(r => r.name === input.name).length !== 1) {
|
|
86
|
-
throw (0,
|
|
86
|
+
throw (0, utils_js_1.createError)(`Found multiple HTML inputs configured with the same name, ` +
|
|
87
87
|
'or with no name which defaults to index.html. Set a unique name on the' +
|
|
88
88
|
'input option.');
|
|
89
89
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getInputData.js","sourceRoot":"","sources":["../../src/input/getInputData.ts"],"names":[],"mappings":";;;;;;AAAA,4CAAoB;AACpB,gDAAwB;AACxB,
|
|
1
|
+
{"version":3,"file":"getInputData.js","sourceRoot":"","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AAa,CAAC,CAAC;gBACrE,MAAM,IAAI,GAAG,YAAE,CAAC,YAAY,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;gBAChD,MAAM,IAAI,GAAG,eAAe,CAAC;oBAC3B,IAAI;oBACJ,IAAI;oBACJ,OAAO;oBACP,QAAQ;oBACR,aAAa;oBACb,kBAAkB;iBACnB,CAAC,CAAC;gBACH,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;aACnB;SACF;aAAM;YACL,MAAM,IAAA,sBAAW,EAAC,8CAA8C,CAAC,CAAC;SACnE;KACF;IAED,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE;QAC1B,IAAI,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,KAAK,CAAC,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE;YAC1D,MAAM,IAAA,sBAAW,EACf,4DAA4D;gBAC1D,wEAAwE;gBACxE,eAAe,CAClB,CAAC;SACH;KACF;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AA9DD,oCA8DC"}
|
|
@@ -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,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.normalizeInputOptions = void 0;
|
|
4
|
-
const
|
|
4
|
+
const utils_js_1 = require("../utils.js");
|
|
5
5
|
function normalizeInputOptions(pluginOptions, rollupInput) {
|
|
6
6
|
if (pluginOptions.input == null) {
|
|
7
7
|
if (rollupInput == null) {
|
|
8
|
-
throw (0,
|
|
8
|
+
throw (0, utils_js_1.createError)('Missing input option in rollup or in HTML plugin options.');
|
|
9
9
|
}
|
|
10
10
|
if (typeof rollupInput === 'string') {
|
|
11
11
|
return [{ path: rollupInput }];
|
|
@@ -16,7 +16,7 @@ function normalizeInputOptions(pluginOptions, rollupInput) {
|
|
|
16
16
|
if (typeof rollupInput === 'object') {
|
|
17
17
|
return Object.entries(rollupInput).map(([name, path]) => ({ name, path }));
|
|
18
18
|
}
|
|
19
|
-
throw (0,
|
|
19
|
+
throw (0, utils_js_1.createError)('Unable to parse rollup input option');
|
|
20
20
|
}
|
|
21
21
|
if (Array.isArray(pluginOptions.input)) {
|
|
22
22
|
return pluginOptions.input.map(input => {
|
|
@@ -32,7 +32,7 @@ function normalizeInputOptions(pluginOptions, rollupInput) {
|
|
|
32
32
|
if (typeof pluginOptions.input === 'string') {
|
|
33
33
|
return [{ path: pluginOptions.input }];
|
|
34
34
|
}
|
|
35
|
-
throw (0,
|
|
35
|
+
throw (0, utils_js_1.createError)('Unable to parse html plugin input option');
|
|
36
36
|
}
|
|
37
37
|
exports.normalizeInputOptions = normalizeInputOptions;
|
|
38
38
|
//# sourceMappingURL=normalizeInputOptions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"normalizeInputOptions.js","sourceRoot":"","sources":["../../src/input/normalizeInputOptions.ts"],"names":[],"mappings":";;;AAEA,
|
|
1
|
+
{"version":3,"file":"normalizeInputOptions.js","sourceRoot":"","sources":["../../src/input/normalizeInputOptions.ts"],"names":[],"mappings":";;;AAEA,0CAA0C;AAE1C,SAAgB,qBAAqB,CACnC,aAAsC,EACtC,WAAyB;IAEzB,IAAI,aAAa,CAAC,KAAK,IAAI,IAAI,EAAE;QAC/B,IAAI,WAAW,IAAI,IAAI,EAAE;YACvB,MAAM,IAAA,sBAAW,EAAC,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,IAAA,sBAAW,EAAC,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,IAAA,sBAAW,EAAC,0CAA0C,CAAC,CAAC;AAChE,CAAC;AA1CD,sDA0CC"}
|
|
@@ -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+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, "__esModule", { value: true });
|
|
3
3
|
exports.createHTMLOutput = exports.createHTMLAsset = void 0;
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const
|
|
4
|
+
const getEntrypointBundles_js_1 = require("./getEntrypointBundles.js");
|
|
5
|
+
const getOutputHTML_js_1 = require("./getOutputHTML.js");
|
|
6
|
+
const utils_js_1 = require("../utils.js");
|
|
7
7
|
async function createHTMLAsset(params) {
|
|
8
8
|
const { outputDir, input, emittedAssets, generatedBundles, externalTransformHtmlFns, pluginOptions, defaultInjectDisabled, serviceWorkerPath, injectServiceWorker, absolutePathPrefix, strictCSPInlineScripts, } = params;
|
|
9
9
|
if (generatedBundles.length === 0) {
|
|
10
|
-
throw (0,
|
|
10
|
+
throw (0, utils_js_1.createError)('Cannot output HTML when no bundles have been generated');
|
|
11
11
|
}
|
|
12
|
-
const entrypointBundles = (0,
|
|
12
|
+
const entrypointBundles = (0, getEntrypointBundles_js_1.getEntrypointBundles)({
|
|
13
13
|
pluginOptions,
|
|
14
14
|
generatedBundles,
|
|
15
15
|
inputModuleIds: input.moduleImports,
|
|
16
16
|
outputDir,
|
|
17
17
|
htmlFileName: input.name,
|
|
18
18
|
});
|
|
19
|
-
const outputHtml = await (0,
|
|
19
|
+
const outputHtml = await (0, getOutputHTML_js_1.getOutputHTML)({
|
|
20
20
|
pluginOptions,
|
|
21
21
|
entrypointBundles,
|
|
22
22
|
input,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createHTMLOutput.js","sourceRoot":"","sources":["../../src/output/createHTMLOutput.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"createHTMLOutput.js","sourceRoot":"","sources":["../../src/output/createHTMLOutput.ts"],"names":[],"mappings":";;;AAAA,uEAAiE;AACjE,yDAAmD;AACnD,0CAA0C;AAwBnC,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,IAAA,sBAAW,EAAC,wDAAwD,CAAC,CAAC;KAC7E;IAED,MAAM,iBAAiB,GAAG,IAAA,8CAAoB,EAAC;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,IAAA,gCAAa,EAAC;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;AA1CD,0CA0CC;AAgBM,KAAK,UAAU,gBAAgB,CAAC,MAA8B;IACnE,OAAO,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,eAAe,iCAAM,MAAM,KAAE,KAAK,IAAG,CAAC,CAAC,CAAC;AACxF,CAAC;AAFD,4CAEC"}
|
|
@@ -5,18 +5,18 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.getEntrypointBundles = exports.createImportPath = void 0;
|
|
7
7
|
const path_1 = __importDefault(require("path"));
|
|
8
|
-
const
|
|
9
|
-
const
|
|
8
|
+
const utils_js_1 = require("../utils.js");
|
|
9
|
+
const utils_js_2 = require("./utils.js");
|
|
10
10
|
function createImportPath(params) {
|
|
11
11
|
const { publicPath, outputDir, fileOutputDir, htmlFileName, fileName } = params;
|
|
12
12
|
const pathFromMainToFileDir = path_1.default.relative(outputDir, fileOutputDir);
|
|
13
13
|
let importPath;
|
|
14
14
|
if (publicPath) {
|
|
15
|
-
importPath = (0,
|
|
15
|
+
importPath = (0, utils_js_2.toBrowserPath)(path_1.default.join(publicPath, pathFromMainToFileDir, fileName));
|
|
16
16
|
}
|
|
17
17
|
else {
|
|
18
18
|
const pathFromHtmlToOutputDir = path_1.default.relative(path_1.default.dirname(htmlFileName), pathFromMainToFileDir);
|
|
19
|
-
importPath = (0,
|
|
19
|
+
importPath = (0, utils_js_2.toBrowserPath)(path_1.default.join(pathFromHtmlToOutputDir, fileName));
|
|
20
20
|
}
|
|
21
21
|
if (importPath.startsWith('http') || importPath.startsWith('/') || importPath.startsWith('.')) {
|
|
22
22
|
return importPath;
|
|
@@ -30,13 +30,13 @@ function getEntrypointBundles(params) {
|
|
|
30
30
|
const entrypointBundles = {};
|
|
31
31
|
for (const { name, options, bundle } of generatedBundles) {
|
|
32
32
|
if (!options.format) {
|
|
33
|
-
throw (0,
|
|
33
|
+
throw (0, utils_js_1.createError)('Missing module format');
|
|
34
34
|
}
|
|
35
35
|
const entrypoints = [];
|
|
36
36
|
for (const chunkOrAsset of Object.values(bundle)) {
|
|
37
37
|
if (chunkOrAsset.type === 'chunk') {
|
|
38
38
|
const chunk = chunkOrAsset;
|
|
39
|
-
if (chunk.isEntry && chunk.facadeModuleId !==
|
|
39
|
+
if (chunk.isEntry && chunk.facadeModuleId !== utils_js_1.NOOP_IMPORT.importPath) {
|
|
40
40
|
const found = inputModuleIds.find(mod => mod.importPath === chunk.facadeModuleId);
|
|
41
41
|
if (chunk.facadeModuleId && found) {
|
|
42
42
|
const importPath = createImportPath({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getEntrypointBundles.js","sourceRoot":"","sources":["../../src/output/getEntrypointBundles.ts"],"names":[],"mappings":";;;;;;AACA,gDAAwB;AASxB,
|
|
1
|
+
{"version":3,"file":"getEntrypointBundles.js","sourceRoot":"","sources":["../../src/output/getEntrypointBundles.ts"],"names":[],"mappings":";;;;;;AACA,gDAAwB;AASxB,0CAAuD;AACvD,yCAA2C;AAU3C,SAAgB,gBAAgB,CAAC,MAA8B;IAC7D,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,aAAa,EAAE,YAAY,EAAE,QAAQ,EAAE,GAAG,MAAM,CAAC;IAChF,MAAM,qBAAqB,GAAG,cAAI,CAAC,QAAQ,CAAC,SAAS,EAAE,aAAa,CAAC,CAAC;IACtE,IAAI,UAAU,CAAC;IACf,IAAI,UAAU,EAAE;QACd,UAAU,GAAG,IAAA,wBAAa,EAAC,cAAI,CAAC,IAAI,CAAC,UAAU,EAAE,qBAAqB,EAAE,QAAQ,CAAC,CAAC,CAAC;KACpF;SAAM;QACL,MAAM,uBAAuB,GAAG,cAAI,CAAC,QAAQ,CAC3C,cAAI,CAAC,OAAO,CAAC,YAAY,CAAC,EAC1B,qBAAqB,CACtB,CAAC;QACF,UAAU,GAAG,IAAA,wBAAa,EAAC,cAAI,CAAC,IAAI,CAAC,uBAAuB,EAAE,QAAQ,CAAC,CAAC,CAAC;KAC1E;IAED,IAAI,UAAU,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,UAAU,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,UAAU,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE;QAC7F,OAAO,UAAU,CAAC;KACnB;IACD,OAAO,KAAK,UAAU,EAAE,CAAC;AAC3B,CAAC;AAlBD,4CAkBC;AAgBD,SAAgB,oBAAoB,CAAC,MAAkC;;IACrE,MAAM,EAAE,aAAa,EAAE,gBAAgB,EAAE,cAAc,EAAE,SAAS,EAAE,YAAY,EAAE,GAAG,MAAM,CAAC;IAC5F,MAAM,iBAAiB,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/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"}
|
|
@@ -12,13 +12,13 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
12
12
|
};
|
|
13
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
14
|
exports.getOutputHTML = void 0;
|
|
15
|
-
const
|
|
15
|
+
const injectBundles_js_1 = require("./injectBundles.js");
|
|
16
16
|
const parse5_1 = require("parse5");
|
|
17
17
|
const html_minifier_terser_1 = require("html-minifier-terser");
|
|
18
|
-
const
|
|
19
|
-
const
|
|
20
|
-
const
|
|
21
|
-
const
|
|
18
|
+
const injectedUpdatedAssetPaths_js_1 = require("./injectedUpdatedAssetPaths.js");
|
|
19
|
+
const injectAbsoluteBaseUrl_js_1 = require("./injectAbsoluteBaseUrl.js");
|
|
20
|
+
const hashInlineScripts_js_1 = require("./hashInlineScripts.js");
|
|
21
|
+
const injectServiceWorkerRegistration_js_1 = require("./injectServiceWorkerRegistration.js");
|
|
22
22
|
async function getOutputHTML(params) {
|
|
23
23
|
const { pluginOptions, entrypointBundles, externalTransformHtmlFns, input, outputDir, emittedAssets, defaultInjectDisabled, serviceWorkerPath, injectServiceWorker, absolutePathPrefix, strictCSPInlineScripts, } = params;
|
|
24
24
|
const { default: defaultBundle } = entrypointBundles, multiBundles = __rest(entrypointBundles, ["default"]);
|
|
@@ -26,7 +26,7 @@ async function getOutputHTML(params) {
|
|
|
26
26
|
// inject rollup output into HTML
|
|
27
27
|
let document = (0, parse5_1.parse)(input.html);
|
|
28
28
|
if (pluginOptions.extractAssets !== false) {
|
|
29
|
-
(0,
|
|
29
|
+
(0, injectedUpdatedAssetPaths_js_1.injectedUpdatedAssetPaths)({
|
|
30
30
|
document,
|
|
31
31
|
input,
|
|
32
32
|
outputDir,
|
|
@@ -37,13 +37,13 @@ async function getOutputHTML(params) {
|
|
|
37
37
|
});
|
|
38
38
|
}
|
|
39
39
|
if (!defaultInjectDisabled) {
|
|
40
|
-
(0,
|
|
40
|
+
(0, injectBundles_js_1.injectBundles)(document, entrypointBundles);
|
|
41
41
|
}
|
|
42
42
|
if (absoluteSocialMediaUrls && pluginOptions.absoluteBaseUrl) {
|
|
43
|
-
(0,
|
|
43
|
+
(0, injectAbsoluteBaseUrl_js_1.injectAbsoluteBaseUrl)(document, pluginOptions.absoluteBaseUrl);
|
|
44
44
|
}
|
|
45
45
|
if (injectServiceWorker && serviceWorkerPath) {
|
|
46
|
-
(0,
|
|
46
|
+
(0, injectServiceWorkerRegistration_js_1.injectServiceWorkerRegistration)({
|
|
47
47
|
document,
|
|
48
48
|
outputDir,
|
|
49
49
|
serviceWorkerPath,
|
|
@@ -82,7 +82,7 @@ async function getOutputHTML(params) {
|
|
|
82
82
|
}
|
|
83
83
|
if (strictCSPInlineScripts) {
|
|
84
84
|
document = (0, parse5_1.parse)(outputHtml);
|
|
85
|
-
(0,
|
|
85
|
+
(0, hashInlineScripts_js_1.hashInlineScripts)(document);
|
|
86
86
|
outputHtml = (0, parse5_1.serialize)(document);
|
|
87
87
|
}
|
|
88
88
|
return outputHtml;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getOutputHTML.js","sourceRoot":"","sources":["../../src/output/getOutputHTML.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"getOutputHTML.js","sourceRoot":"","sources":["../../src/output/getOutputHTML.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,yDAAmD;AAOnD,mCAA0C;AAC1C,+DAAgE;AAChE,iFAA2E;AAE3E,yEAAmE;AACnE,iEAA2D;AAC3D,6FAAuF;AAgBhF,KAAK,UAAU,aAAa,CAAC,MAA2B;IAC7D,MAAM,EACJ,aAAa,EACb,iBAAiB,EACjB,wBAAwB,EACxB,KAAK,EACL,SAAS,EACT,aAAa,EACb,qBAAqB,EACrB,iBAAiB,EACjB,mBAAmB,EACnB,kBAAkB,EAClB,sBAAsB,GACvB,GAAG,MAAM,CAAC;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