Skip to content

Commit d96128e

Browse files
committed
refactor
1 parent 9afb009 commit d96128e

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

packages/vike-server/src/plugin/plugins/setPhotonMeta.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,12 @@ import type { Plugin } from 'vite'
33
export function setPhotonMeta(): Plugin {
44
return {
55
name: 'vike-server:set-photon-meta',
6-
transform(_code, id) {
7-
if (id.match(/\+middleware\.[jt]s/)) {
8-
// Forces full-reload when a +middleware file is modified
6+
transform: {
7+
filter: {
8+
id: [/\+middleware\.[jt]s/]
9+
},
10+
handler(_code, id) {
11+
// Forces full-reload on server side when a +middleware file is modified
912
return { meta: { photonConfig: { isGlobal: true } } }
1013
}
1114
}

packages/vike-server/src/plugin/plugins/standalonePlugin.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ const OPTIONAL_NPM_IMPORTS = [
1414
'class-transformer'
1515
]
1616

17+
// TODO should this be moved to Photon, under node target?
1718
export function standalonePlugin(): Plugin {
1819
let root = ''
1920
let outDir = ''

packages/vike-server/src/plugin/plugins/vikeServerConfigToPhotonPlugin.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { getVikeConfig } from 'vike/plugin'
22
import type { Plugin } from 'vite'
33

4+
// Forward config from Vike to Photon
45
export function vikeServerConfigToPhotonPlugin(): Plugin {
56
return {
67
name: 'vike-server:to-photon-config',

0 commit comments

Comments
 (0)