feat(admin): Improve DX for deploying admin externally (#3418)
* init deploy command * add include flag * add 'shortcut' flag * add dev command, fix var replacement, change default behaviour * cleanup params of build command * fix defaults when using the plugin to serve admin * add changeset * fix globals * update README * throw error on no build found --------- Co-authored-by: Oliver Windall Juhl <59018053+olivermrbl@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
9ad15d3a88
commit
8a7421db5b
@@ -15,6 +15,7 @@ export const loadConfig = () => {
|
||||
|
||||
let defaultConfig: PluginOptions = {
|
||||
serve: true,
|
||||
autoRebuild: false,
|
||||
path: "app",
|
||||
}
|
||||
|
||||
@@ -22,8 +23,8 @@ export const loadConfig = () => {
|
||||
const { options } = plugin as { options: PluginOptions }
|
||||
defaultConfig = {
|
||||
serve: options.serve ?? defaultConfig.serve,
|
||||
autoRebuild: options.autoRebuild ?? defaultConfig.autoRebuild,
|
||||
path: options.path ?? defaultConfig.path,
|
||||
backend: options.backend ?? defaultConfig.backend,
|
||||
outDir: options.outDir ?? defaultConfig.outDir,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
export const validatePath = (path: string) => {
|
||||
export const validatePath = (path?: string) => {
|
||||
if (!path) {
|
||||
return
|
||||
}
|
||||
|
||||
if (path.startsWith("/")) {
|
||||
throw new Error(`Path cannot start with a slash.`)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user