-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add development only scripts, update readme
- Loading branch information
Rasmus Schmidt
committed
Jun 25, 2024
1 parent
804f93e
commit 46c0134
Showing
4 changed files
with
98 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
prototype(Networkteam.Neos.Vite:Body.Assets) < prototype(Neos.Fusion:Join) { | ||
developmentOnlyScripts = Networkteam.Neos.Vite:Helper.DevelopmentOnlyScripts { | ||
@context.viteUrl = ${Configuration.setting('Networkteam.Neos.Vite.server._default.url')} | ||
// insert the vite client scripts | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
prototype(Networkteam.Neos.Vite:Head.Assets) < prototype(Neos.Fusion:Join) { | ||
developmentOnlyScripts = Networkteam.Neos.Vite:Helper.DevelopmentOnlyScripts { | ||
@context.viteUrl = ${Configuration.setting('Networkteam.Neos.Vite.server._default.url')} | ||
// Inject the react-refresh runtime into the page see: https://vitejs.dev/guide/backend-integration | ||
reactRefresh = ${"<script type='module'>import RefreshRuntime from '" + viteUrl + "@react-refresh';RefreshRuntime.injectIntoGlobalHook(window);window.$RefreshReg$ = () => {};window.$RefreshSig$ = () => (type) => type;window.__vite_plugin_react_preamble_installed__ = true</script>"} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/** | ||
* Usage: | ||
* developmentOnlyScripts = Viebrockhaus.Base:Helper.DevelopmentOnlyScripts { | ||
* @context.viteUrl = ${Configuration.setting('Networkteam.Neos.Vite.server._default.url')} | ||
* 0 = ${'<script type="module" src="' + viteUrl + '@vite-plugin-svg-spritemap/client"></script>'} | ||
* } | ||
* | ||
*/ | ||
|
||
prototype(Networkteam.Neos.Vite:Helper.DevelopmentOnlyScripts) < prototype(Neos.Fusion:Join) { | ||
@context { | ||
flowContext = ${Configuration.setting('Neos.Flow.core.context')} | ||
} | ||
@if.isDevelopmentContext = ${String.indexOf(flowContext, 'Development') >= 0} | ||
} | ||
|
||
prototype(Networkteam.Neos.Vite:Helper.IsDevelopmentOnly) < prototype(Neos.Fusion:Case) { | ||
@context { | ||
flowContext = ${Configuration.setting('Neos.Flow.core.context')} | ||
} | ||
|
||
inDevelopment { | ||
condition = ${String.indexOf(flowContext, 'Development') >= 0} | ||
renderer = ${true} | ||
} | ||
|
||
default { | ||
condition = ${true} | ||
renderer = ${false} | ||
} | ||
} |