Skip to content

Commit

Permalink
Update build.cjs
Browse files Browse the repository at this point in the history
  • Loading branch information
rouzwelt committed Feb 19, 2025
1 parent a34e013 commit 0cacf81
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions tauri-app/scripts/build.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,21 @@ const { execSync } = require('node:child_process');
fs.mkdirSync('./temp', { recursive: true });
fs.mkdirSync('./src/lib/types', { recursive: true });

// generate bindgens
// generate bindings
execSync(
`wasm-bindgen --target nodejs ./src-tauri/target/wasm32-unknown-unknown/release/tauri_app.wasm --out-dir ./temp --out-name tauriBindings`,
'wasm-bindgen --target nodejs ./src-tauri/target/wasm32-unknown-unknown/release/tauri_app.wasm --out-dir ./temp --out-name tauriBindings',
);

// prepare and move to src/lib/types
let dts = fs.readFileSync(`./temp/tauriBindings.d.ts`, {
// prepare and move to src/lib/types as we only need the generated typings
let ts = fs.readFileSync(`./temp/tauriBindings.d.ts`, {
encoding: 'utf-8',
});
dts = dts.replace(
ts = ts.replace(
`/* tslint:disable */
/* eslint-disable */`,
'',
);
dts = '/* this file is auto-generated, do not modify */\n' + dts;
fs.writeFileSync(`./src/lib/types/tauriBindings.ts`, dts);
ts = '/* this file is auto-generated, do not modify */\n' + ts;
fs.writeFileSync('./src/lib/types/tauriBindings.ts', ts);

execSync('npm run rm-temp');

0 comments on commit 0cacf81

Please sign in to comment.