@aerobuilt/core 0.2.5 → 0.2.6
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 +2 -2
- package/dist/types.d.ts +1 -1
- package/dist/vite/index.d.ts +1 -1
- package/dist/vite/index.js +6 -6
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -65,7 +65,7 @@ const html = await aero.render('index', { props: { title: 'Home' } })
|
|
|
65
65
|
|
|
66
66
|
### Vite plugin
|
|
67
67
|
|
|
68
|
-
- **Plugin** from `aerobuilt/vite`: `aero(options?)`. Options: `
|
|
68
|
+
- **Plugin** from `aerobuilt/vite`: `aero(options?)`. Options: `server`, `apiPrefix`, `dirs`, `site` (canonical URL; exposed as `import.meta.env.SITE` and `Aero.site`; when set, generates `dist/sitemap.xml` after build).
|
|
69
69
|
- Sub-plugins: config resolution, virtual client modules (`\0`-prefixed), HTML transform, SSR middleware, HMR.
|
|
70
70
|
- Build: page discovery, static render, optional Nitro build, optional image optimizer (sharp/svgo).
|
|
71
71
|
|
|
@@ -74,7 +74,7 @@ const html = await aero.render('index', { props: { title: 'Home' } })
|
|
|
74
74
|
```js
|
|
75
75
|
import { aero } from 'aerobuilt/vite'
|
|
76
76
|
export default {
|
|
77
|
-
plugins: [aero({
|
|
77
|
+
plugins: [aero({ server: true })],
|
|
78
78
|
}
|
|
79
79
|
```
|
|
80
80
|
|
package/dist/types.d.ts
CHANGED
|
@@ -22,7 +22,7 @@ interface RedirectRule {
|
|
|
22
22
|
}
|
|
23
23
|
interface AeroOptions {
|
|
24
24
|
/** Enable Nitro server integration (default: `false`). */
|
|
25
|
-
|
|
25
|
+
server?: boolean;
|
|
26
26
|
/** API route prefix (default: `'/api'`). */
|
|
27
27
|
apiPrefix?: string;
|
|
28
28
|
/** Directory overrides. */
|
package/dist/vite/index.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ import { PluginOption } from 'vite';
|
|
|
15
15
|
* HMR for templates and content is handled by Vite's dependency graph when the app uses a single
|
|
16
16
|
* client entry that imports @aerobuilt/core and calls aero.mount().
|
|
17
17
|
*
|
|
18
|
-
* @param options - AeroOptions (
|
|
18
|
+
* @param options - AeroOptions (server, apiPrefix, dirs). Server can be disabled at runtime via AERO_SERVER=false.
|
|
19
19
|
* @returns PluginOption[] to pass to Vite's plugins array.
|
|
20
20
|
*/
|
|
21
21
|
declare function aero(options?: AeroOptions): PluginOption[];
|
package/dist/vite/index.js
CHANGED
|
@@ -1405,8 +1405,8 @@ async function renderStaticPages(options, outDir) {
|
|
|
1405
1405
|
const discoveredPages = discoverPages(root, path3.join(dirs.client, "pages"));
|
|
1406
1406
|
const distDir = path3.resolve(root, outDir);
|
|
1407
1407
|
const manifest = readManifest(distDir);
|
|
1408
|
-
const
|
|
1409
|
-
process.env.
|
|
1408
|
+
const previousAeroServer = process.env.AERO_SERVER;
|
|
1409
|
+
process.env.AERO_SERVER = "false";
|
|
1410
1410
|
const staticCacheDir = path3.join(root, ".aero", "vite-ssr");
|
|
1411
1411
|
const server = await createServer({
|
|
1412
1412
|
configFile: false,
|
|
@@ -1505,10 +1505,10 @@ async function renderStaticPages(options, outDir) {
|
|
|
1505
1505
|
}
|
|
1506
1506
|
} finally {
|
|
1507
1507
|
await server.close();
|
|
1508
|
-
if (
|
|
1509
|
-
delete process.env.
|
|
1508
|
+
if (previousAeroServer === void 0) {
|
|
1509
|
+
delete process.env.AERO_SERVER;
|
|
1510
1510
|
} else {
|
|
1511
|
-
process.env.
|
|
1511
|
+
process.env.AERO_SERVER = previousAeroServer;
|
|
1512
1512
|
}
|
|
1513
1513
|
}
|
|
1514
1514
|
}
|
|
@@ -1876,7 +1876,7 @@ function createAeroSsrPlugin(state) {
|
|
|
1876
1876
|
function aero(options = {}) {
|
|
1877
1877
|
const dirs = resolveDirs(options.dirs);
|
|
1878
1878
|
const apiPrefix = options.apiPrefix || DEFAULT_API_PREFIX;
|
|
1879
|
-
const enableNitro = options.
|
|
1879
|
+
const enableNitro = options.server === true && process.env.AERO_SERVER !== "false";
|
|
1880
1880
|
const runtimeInstanceJsPath = fileURLToPath(
|
|
1881
1881
|
new URL("../runtime/instance.js", import.meta.url)
|
|
1882
1882
|
);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aerobuilt/core",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.6",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Jamie Wilson",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"sharp": "^0.34.5",
|
|
56
56
|
"svgo": "^4.0.0",
|
|
57
57
|
"vite-plugin-image-optimizer": "^2.0.3",
|
|
58
|
-
"@aerobuilt/interpolation": "0.2.
|
|
58
|
+
"@aerobuilt/interpolation": "0.2.6"
|
|
59
59
|
},
|
|
60
60
|
"peerDependencies": {
|
|
61
61
|
"vite": "^8.0.0-0"
|