houdini-adapter-static 1.2.65 → 1.3.0
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/build/index.js +6 -6
- package/package.json +2 -2
package/build/index.js
CHANGED
|
@@ -6,18 +6,18 @@ import ReactDOM from 'react-dom/server';
|
|
|
6
6
|
// in order to prepare the app as a single-page app, we have 2 create 2 additional files:
|
|
7
7
|
// - an index.js that imports the application and calls React.render. This file needs to be built by vite so it's passed with the includePaths option for an adapter
|
|
8
8
|
// - an index.html containing the static shell that wraps the application.
|
|
9
|
-
const adapter = async ({ outDir }) => {
|
|
9
|
+
const adapter = async ({ outDir, config: { runtimeDir } }) => {
|
|
10
10
|
// the first thing we need to do is pull out the rendered html file into the root of the outDir
|
|
11
|
-
await fs.copyFile(path.join(outDir, 'assets',
|
|
11
|
+
await fs.copyFile(path.join(outDir, 'assets', runtimeDir, 'temp', 'spa-shell', 'index.html'), path.join(outDir, 'index.html'));
|
|
12
12
|
try {
|
|
13
|
-
await fs.rmdir(path.join(outDir, 'assets',
|
|
13
|
+
await fs.rmdir(path.join(outDir, 'assets', runtimeDir));
|
|
14
14
|
}
|
|
15
15
|
catch { }
|
|
16
16
|
};
|
|
17
17
|
// make sure we include the app entry point in the bundle
|
|
18
|
-
adapter.includePaths = {
|
|
19
|
-
shell: '
|
|
20
|
-
};
|
|
18
|
+
adapter.includePaths = ({ config: { runtimeDir } }) => ({
|
|
19
|
+
shell: path.join(runtimeDir, 'temp', 'spa-shell', 'index.html'),
|
|
20
|
+
});
|
|
21
21
|
// we dont want any server artifacts to be generated
|
|
22
22
|
adapter.disableServer = true;
|
|
23
23
|
adapter.pre = async ({ config, outDir, conventions }) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "houdini-adapter-static",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"description": "The adapter for deploying your Houdini application as a single-page application without a server component",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"houdini",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"react": "19.0.0-rc-eb259b5d3b-20240605",
|
|
28
28
|
"react-dom": "19.0.0-rc-eb259b5d3b-20240605",
|
|
29
29
|
"vite": "^4.1.4",
|
|
30
|
-
"houdini": "^1.
|
|
30
|
+
"houdini": "^1.4.0"
|
|
31
31
|
},
|
|
32
32
|
"files": [
|
|
33
33
|
"build"
|