Skip to content

Commit

Permalink
fix: runtime path should consider base (#135)
Browse files Browse the repository at this point in the history
  • Loading branch information
fi3ework committed Apr 14, 2022
1 parent 5aa278c commit 356b664
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/vite-plugin-checker/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ export default function Plugin(userConfig: UserPluginConfig): Plugin {
const enableOverlay = userConfig?.overlay !== false
const enableTerminal = userConfig?.terminal !== false
const overlayConfig = typeof userConfig?.overlay === 'object' ? userConfig?.overlay : null
let resolvedRuntimePath = RUNTIME_PUBLIC_PATH
let checkers: ServeAndBuildChecker[] = []
let viteMode: ConfigEnv['command'] | undefined
let resolvedConfig: ResolvedConfig | undefined
Expand All @@ -71,6 +72,7 @@ export default function Plugin(userConfig: UserPluginConfig): Plugin {
},
configResolved(config) {
resolvedConfig = config
resolvedRuntimePath = config.base + RUNTIME_PUBLIC_PATH.slice(1)
},
buildEnd() {
if (viteMode === 'serve') {
Expand Down Expand Up @@ -137,7 +139,7 @@ export default function Plugin(userConfig: UserPluginConfig): Plugin {
{
tag: 'script',
attrs: { type: 'module' },
children: `import { inject } from "${RUNTIME_PUBLIC_PATH}"; inject();`,
children: `import { inject } from "${resolvedRuntimePath}"; inject();`,
},
]
}
Expand Down

0 comments on commit 356b664

Please sign in to comment.