mokup 2.3.0 → 2.3.2

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.
@@ -1,47 +0,0 @@
1
- 'use strict';
2
-
3
- const manifest = require('./mokup.Dy9VDphS.cjs');
4
-
5
- function buildBundleModule(params) {
6
- const { manifest: manifest$1, modules } = manifest.buildManifestData({
7
- routes: params.routes,
8
- root: params.root,
9
- ...params.resolveModulePath ? { resolveModulePath: params.resolveModulePath } : {}
10
- });
11
- const imports = [];
12
- const moduleEntries = [];
13
- let moduleIndex = 0;
14
- for (const entry of modules) {
15
- const name = `module${moduleIndex++}`;
16
- imports.push(`import * as ${name} from '${entry.id}'`);
17
- moduleEntries.push({ id: entry.id, name });
18
- }
19
- const lines = [];
20
- if (imports.length > 0) {
21
- lines.push(...imports, "");
22
- }
23
- lines.push(
24
- `const manifest = ${JSON.stringify(manifest$1, null, 2)}`,
25
- ""
26
- );
27
- if (moduleEntries.length > 0) {
28
- lines.push("const moduleMap = {");
29
- for (const entry of moduleEntries) {
30
- lines.push(
31
- ` ${JSON.stringify(entry.id)}: ${entry.name},`
32
- );
33
- }
34
- lines.push("}", "");
35
- }
36
- const runtimeOptions = moduleEntries.length > 0 ? "{ manifest, moduleMap }" : "{ manifest }";
37
- lines.push(
38
- `const mokupBundle = ${runtimeOptions}`,
39
- "",
40
- "export default mokupBundle",
41
- "export { mokupBundle }",
42
- ""
43
- );
44
- return lines.join("\n");
45
- }
46
-
47
- exports.buildBundleModule = buildBundleModule;