Skip to content

Commit

Permalink
upd: add window.__QUASI_PREVIEW__ in preview iframe
Browse files Browse the repository at this point in the history
  • Loading branch information
KermanX committed Nov 23, 2023
1 parent 9783f39 commit c11f8c7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/northstar/src/views/preview.r.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
6 changes: 6 additions & 0 deletions packages/runtime/src/types/env.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
declare global {
interface Window {
__QUASI_PREVIEW__: boolean;
}
}
export {};

0 comments on commit c11f8c7

Please sign in to comment.