File tree 3 files changed +26
-4
lines changed
3 files changed +26
-4
lines changed Original file line number Diff line number Diff line change 70
70
- name : Build the Markdown Editor Example
71
71
run : |
72
72
npm install
73
- pushd markdown-renderer
74
- cargo build --release --target=wasm32-wasi
75
- popd
76
73
npm run build
77
74
working-directory : " examples/markdown-editor"
78
75
- name : Build the (Improved) Markdown Editor Example
Original file line number Diff line number Diff line change 2
2
"compilerOptions" : {
3
3
"lib" : [
4
4
" DOM"
5
- ]
5
+ ],
6
+ "target" : " ES2017" ,
7
+ "module" : " ESNext" ,
8
+ "moduleResolution" : " Bundler"
6
9
}
7
10
}
Original file line number Diff line number Diff line change 1
1
import { defineConfig } from "vite" ;
2
+ import { exec } from "node:child_process" ;
2
3
3
4
export default defineConfig ( {
4
5
server : {
@@ -7,5 +8,26 @@ export default defineConfig({
7
8
"Cross-Origin-Embedder-Policy" : "require-corp" ,
8
9
} ,
9
10
} ,
11
+ plugins : [
12
+ {
13
+ name : "cargo-build" ,
14
+ buildStart : ( ) => {
15
+ return new Promise ( ( resolve , reject ) => {
16
+ exec (
17
+ "cargo build --target=wasm32-wasi --manifest-path=markdown-renderer/Cargo.toml --release --quiet" ,
18
+ ( err , stdout , stderr ) => {
19
+ if ( err ) {
20
+ console . log ( "Stdout:" , stdout ) ;
21
+ console . log ( "Stderr:" , stderr ) ;
22
+ reject ( err ) ;
23
+ } else {
24
+ resolve ( ) ;
25
+ }
26
+ }
27
+ ) ;
28
+ } ) ;
29
+ }
30
+ } ,
31
+ ]
10
32
} ) ;
11
33
You can’t perform that action at this time.
0 commit comments