vite-plugin-htjs-pages 0.2.0 → 0.3.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/README.md +4 -4
- package/package.json +2 -2
- package/src/errors.ts +2 -2
- package/src/plugin.ts +2 -2
- package/dist/chunk-XFMAP2PF.js +0 -23177
- package/dist/chunk-XFMAP2PF.js.map +0 -1
- package/dist/index.cjs +0 -23499
- package/dist/index.cjs.map +0 -1
- package/dist/index.d.cts +0 -44
- package/dist/index.d.ts +0 -44
- package/dist/index.js +0 -447
- package/dist/index.js.map +0 -1
- package/dist/watch-KN535AIO.js +0 -6933
- package/dist/watch-KN535AIO.js.map +0 -1
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# vite-plugin-
|
|
1
|
+
# vite-plugin-htjs-pages
|
|
2
2
|
|
|
3
3
|
A lightweight Vite plugin for generating static HTML from `*.ht.js` page modules.
|
|
4
4
|
|
|
@@ -24,7 +24,7 @@ This makes it ideal for **blogs, documentation sites, and marketing pages** wher
|
|
|
24
24
|
# Installation
|
|
25
25
|
|
|
26
26
|
```bash
|
|
27
|
-
npm install vite-plugin-
|
|
27
|
+
npm install vite-plugin-htjs-pages --save-dev
|
|
28
28
|
```
|
|
29
29
|
|
|
30
30
|
---
|
|
@@ -35,7 +35,7 @@ npm install vite-plugin-ht-pages --save-dev
|
|
|
35
35
|
|
|
36
36
|
```ts
|
|
37
37
|
import { defineConfig } from 'vite'
|
|
38
|
-
import { htPages } from 'vite-plugin-
|
|
38
|
+
import { htPages } from 'vite-plugin-htjs-pages'
|
|
39
39
|
|
|
40
40
|
export default defineConfig({
|
|
41
41
|
plugins: [htPages()]
|
|
@@ -484,7 +484,7 @@ This keeps memory usage stable during builds.
|
|
|
484
484
|
|----|----|
|
|
485
485
|
| Astro | full framework |
|
|
486
486
|
| Next.js | SSR framework |
|
|
487
|
-
| vite-plugin-
|
|
487
|
+
| vite-plugin-htjs-pages | minimal static HTML generation |
|
|
488
488
|
|
|
489
489
|
This plugin intentionally stays **small and unopinionated**.
|
|
490
490
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vite-plugin-htjs-pages",
|
|
3
3
|
"author": "Paul Browne",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.3.1",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "Small HT.js pages plugin for Vite with dynamic routes, catch-all routes, and static params",
|
|
7
7
|
"main": "./dist/index.cjs",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"typecheck": "tsc --noEmit"
|
|
20
20
|
},
|
|
21
21
|
"peerDependencies": {
|
|
22
|
-
"vite": "
|
|
22
|
+
"vite": ">=5"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"fast-glob": "^3.3.3",
|
package/src/errors.ts
CHANGED
|
@@ -2,12 +2,12 @@ import type { HtPageInfo } from './types';
|
|
|
2
2
|
|
|
3
3
|
export function invalidHtmlReturn(page: HtPageInfo, value: unknown): Error {
|
|
4
4
|
return new Error(
|
|
5
|
-
`[vite-plugin-
|
|
5
|
+
`[vite-plugin-htjs-pages] Page "${page.relativePath}" must resolve to an HTML string, got ${typeof value}`,
|
|
6
6
|
);
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
export function pageError(page: HtPageInfo, cause: unknown): Error {
|
|
10
|
-
const message = `[vite-plugin-
|
|
10
|
+
const message = `[vite-plugin-htjs-pages] Failed to render ${page.relativePath} (${page.routePath})`;
|
|
11
11
|
if (cause instanceof Error && cause.stack) {
|
|
12
12
|
const err = new Error(message);
|
|
13
13
|
err.stack = `${err.stack}
|
package/src/plugin.ts
CHANGED
|
@@ -61,7 +61,7 @@ export function htPages(options: HtPagesPluginOptions = {}): Plugin {
|
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
return {
|
|
64
|
-
name: 'vite-plugin-
|
|
64
|
+
name: 'vite-plugin-htjs-pages',
|
|
65
65
|
|
|
66
66
|
configResolved(resolved) {
|
|
67
67
|
config = resolved;
|
|
@@ -101,7 +101,7 @@ export function htPages(options: HtPagesPluginOptions = {}): Plugin {
|
|
|
101
101
|
|
|
102
102
|
async generateBundle() {
|
|
103
103
|
const entries = await discoverEntryPages(root, options);
|
|
104
|
-
const cacheDir = path.join(root, 'node_modules/.cache/vite-plugin-
|
|
104
|
+
const cacheDir = path.join(root, 'node_modules/.cache/vite-plugin-htjs-pages');
|
|
105
105
|
|
|
106
106
|
const entriesKey = createEntriesKey(entries);
|
|
107
107
|
|