Skip to content

Commit

Permalink
It works
Browse files Browse the repository at this point in the history
  • Loading branch information
NullVoxPopuli committed Dec 1, 2023
1 parent 0948f16 commit 00d8d6f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion packages/ember-repl/addon/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
"scripts": {
"build": "concurrently 'npm:build:*'",
"build:js": "rollup --config",
"build:types": "tsc --emitDeclarationOnly --noEmit false",
"---build:types": "tsc --emitDeclarationOnly --noEmit false",
"lint:types": "tsc --noEmit",
"lint:fix": "pnpm -w exec lint fix",
"start": "rollup --config --watch",
Expand Down
12 changes: 7 additions & 5 deletions packages/ember-repl/addon/src/browser/gjs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,19 @@ import type { Babel } from './types.ts';

const compiler = importSync('ember-source/dist/ember-template-compiler.js');

import { createPreprocessor } from 'content-tag/standalone';

let processor;
let processor: any;
let fetchingPromise: Promise<any>;

export async function preprocess(input: string, name: string): Promise<string> {
if (!fetchingPromise) {
fetchingPromise = createPreprocessor();
fetchingPromise = import('content-tag');
}

processor = await fetchingPromise;
if (!processor) {
let { Preprocessor } = await fetchingPromise;

processor = new Preprocessor();
}

return processor.process(input, `${name}.js`);
}
Expand Down

0 comments on commit 00d8d6f

Please sign in to comment.