File tree 2 files changed +2
-0
lines changed
2 files changed +2
-0
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ const __filename = fileURLToPath(import.meta.url);
10
10
const __dirname = path . dirname ( __filename ) ;
11
11
const url = 'https://docs.opencv.org/5.x/opencv.js' ;
12
12
const wasmFilePath = path . join ( __dirname , './public/opencv.wasm' ) ;
13
+ const wasmFilePathSrc = path . join ( __dirname , './src/opencv.wasm' ) ;
13
14
const jsOutputFilePath = path . join ( __dirname , './src/opencv.mjs' ) ;
14
15
15
16
async function fetchFile ( url ) {
@@ -36,6 +37,7 @@ async function processFile(data) {
36
37
const base64Data = wasmDataUriMatch [ 1 ] ;
37
38
const binaryData = Buffer . from ( base64Data , 'base64' ) ;
38
39
await writeFile ( wasmFilePath , binaryData ) ;
40
+ await writeFile ( wasmFilePathSrc , binaryData ) ;
39
41
console . log ( 'WASM file saved as opencv.wasm' ) ;
40
42
41
43
let updatedData = data . replace ( wasmDataUriMatch [ 0 ] , 'wasmBinaryFile = "opencv.wasm"' ) ;
You can’t perform that action at this time.
0 commit comments