diff --git a/packages/northstar/src/views/preview.r.ts b/packages/northstar/src/views/preview.r.ts index d7789b4..ea484cb 100644 --- a/packages/northstar/src/views/preview.r.ts +++ b/packages/northstar/src/views/preview.r.ts @@ -25,7 +25,7 @@ let errorMsg = ""; export async function startPreview() { const compiler = new Compiler(currentProject.toOutput()); compiler.runtimeModuleURL = runtimeURL; - code.js = transformer.transform("$", await compiler.compile()); + code.js = "window.__QUASI_PREVIEW__ = true; \n\n" + transformer.transform("$", await compiler.compile()); code.css = ( await compileTailwindCSS( `@tailwind base; diff --git a/packages/runtime/src/types/env.ts b/packages/runtime/src/types/env.ts new file mode 100644 index 0000000..5385489 --- /dev/null +++ b/packages/runtime/src/types/env.ts @@ -0,0 +1,6 @@ +declare global { + interface Window { + __QUASI_PREVIEW__: boolean; + } +} +export {};