-
Notifications
You must be signed in to change notification settings - Fork 46
Expand file tree
/
Copy pathindex.mjs
More file actions
48 lines (41 loc) · 1.63 KB
/
index.mjs
File metadata and controls
48 lines (41 loc) · 1.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
'use strict';
import { join } from 'node:path';
import { GITHUB_EDIT_URL } from '../../utils/configuration/templates.mjs';
import { createLazyGenerator } from '../../utils/generators.mjs';
/**
* Web generator - transforms JSX AST entries into complete web bundles.
*
* This generator processes JSX AST entries and produces:
* - Server-side rendered HTML pages
* - Client-side JavaScript with code splitting
* - Bundled CSS styles
*
* Note: This generator does NOT support streaming/chunked processing because
* processJSXEntries needs all entries together to generate code-split bundles.
*
* @type {import('./types').Generator}
*/
export default createLazyGenerator({
name: 'web',
version: '1.0.0',
description: 'Generates HTML/CSS/JS bundles from JSX AST entries',
dependsOn: 'jsx-ast',
defaultConfiguration: {
templatePath: join(import.meta.dirname, 'template.html'),
project: 'Node.js',
title: '{project} {version} Documentation',
useAbsoluteURLs: false,
editURL: `${GITHUB_EDIT_URL}/doc/api{path}.md`,
pageURL: '{baseURL}/latest-{version}/api{path}.html',
remoteConfig: 'https://nodejs.org/site.json',
imports: {
'#theme/Logo': '@node-core/ui-components/Common/NodejsLogo',
'#theme/Navigation': join(import.meta.dirname, './ui/components/NavBar'),
'#theme/Sidebar': join(import.meta.dirname, './ui/components/SideBar'),
'#theme/Metabar': join(import.meta.dirname, './ui/components/MetaBar'),
'#theme/Footer': join(import.meta.dirname, './ui/components/NoOp'),
'#theme/Layout': join(import.meta.dirname, './ui/components/Layout'),
},
virtualImports: {},
},
});