@wix/origami-site 1.0.9 → 1.0.10
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wix/origami-site",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.10",
|
|
4
4
|
"description": "Runs an exported Wix origami site: file-based routing, Wix dynamic pages, popups and build checks. Use with @wix/origami-site-astro or @wix/origami-site-express.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
@@ -93,5 +93,5 @@
|
|
|
93
93
|
"optional": true
|
|
94
94
|
}
|
|
95
95
|
},
|
|
96
|
-
"falconPackageHash": "
|
|
96
|
+
"falconPackageHash": "adf1f670b7c5ffaf57ca65443b6b006f84ebaebb635a8afeaa45f2eb"
|
|
97
97
|
}
|
package/src/build/index.js
CHANGED
|
@@ -5,6 +5,7 @@ import { sharedPackages } from './sharedPackages.js'
|
|
|
5
5
|
import { wrapperAliases } from './wrapperAliases.js'
|
|
6
6
|
import { browserEnv } from './browserEnv.js'
|
|
7
7
|
import { dedupeFontFaces } from './dedupeFontFaces.js'
|
|
8
|
+
import { servicesConfigsReload } from './servicesConfigsReload.js'
|
|
8
9
|
|
|
9
10
|
/** @param {import('./index.js').OrigamiVitePluginsOptions} options
|
|
10
11
|
* @returns {import('vite').Plugin[]} */
|
|
@@ -13,6 +14,7 @@ export function origamiVitePlugins({ root, siteTree }) {
|
|
|
13
14
|
globalImports(root),
|
|
14
15
|
pageList(siteTree),
|
|
15
16
|
...transforms({ root }),
|
|
17
|
+
servicesConfigsReload(root),
|
|
16
18
|
sharedPackages(),
|
|
17
19
|
wrapperAliases(root),
|
|
18
20
|
browserEnv(),
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { resolve, sep } from 'node:path'
|
|
2
|
+
|
|
3
|
+
/** Reloads the document when a file under a unit's `servicesConfigs/` folder changes. Services are created once
|
|
4
|
+
* per document with the merged configs, so a hot update would keep the old values and register the configs twice.
|
|
5
|
+
* @param {string} root
|
|
6
|
+
* @returns {import('vite').Plugin} */
|
|
7
|
+
export const servicesConfigsReload = root => {
|
|
8
|
+
const src = `${resolve(root, 'src')}${sep}`
|
|
9
|
+
return {
|
|
10
|
+
name: 'origami:services-configs-reload',
|
|
11
|
+
handleHotUpdate({ file, server }) {
|
|
12
|
+
const path = resolve(file)
|
|
13
|
+
if (!path.startsWith(src) || !path.slice(src.length).split(sep).includes('servicesConfigs')) return undefined
|
|
14
|
+
server.ws.send({ type: 'full-reload', path: '*' })
|
|
15
|
+
return []
|
|
16
|
+
},
|
|
17
|
+
}
|
|
18
|
+
}
|