Skip to content

Commit

Permalink
dev: update cetz-editor building
Browse files Browse the repository at this point in the history
  • Loading branch information
Myriad-Dreamin committed Nov 2, 2023
1 parent 001c62f commit 59c1e71
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/gh_pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ jobs:
cmd: install
- name: Build Typescript packages
run: |
npx turbo run build
yarn run build:pkg
- name: Prepare artifacts
run: |
typst-book build --font-path assets/fonts --path-to-root /typst.ts/cookery/ -w . -d ../../github-pages/cookery/ docs/cookery
Expand Down
20 changes: 17 additions & 3 deletions projects/cetz-editor/src/index.mts
Original file line number Diff line number Diff line change
@@ -1,13 +1,27 @@
import { $typst } from '@myriaddreamin/typst.ts/dist/esm/contrib/snippet.mjs';
// let compiler = fetch(
// 'http://127.0.0.1:20810/base/node_modules/@myriaddreamin/typst-ts-web-compiler/pkg/typst_ts_web_compiler_bg.wasm',
// );

// Use CDN
let compiler = fetch(
'https://cdn.jsdelivr.net/npm/@myriaddreamin/typst-ts-web-compiler/pkg/typst_ts_web_compiler_bg.wasm',
);
let renderer = fetch(
'https://cdn.jsdelivr.net/npm/@myriaddreamin/typst-ts-renderer/pkg/typst_ts_renderer_bg.wasm',
);

// Use local server
// let compiler = fetch(
// 'http://127.0.0.1:20810/base/node_modules/@myriaddreamin/typst-ts-web-compiler/pkg/typst_ts_web_compiler_bg.wasm',
// );
// let renderer = fetch(
// 'http://127.0.0.1:20810/base/node_modules/@myriaddreamin/typst-ts-renderer/pkg/typst_ts_renderer_bg.wasm',
// );

// Bundle
// @ts-ignore
// import compiler from '@myriaddreamin/typst-ts-web-compiler/pkg/typst_ts_web_compiler_bg.wasm?url';
// @ts-ignore
// import renderer from '@myriaddreamin/typst-ts-renderer/pkg/typst_ts_renderer_bg.wasm?url';

$typst.setCompilerInitOptions({
getModule: () => compiler,
});
Expand Down

0 comments on commit 59c1e71

Please sign in to comment.