Skip to content

Commit f97a683

Browse files
switch inject method
This method doesn't work when used in downstream repo for some reason.
1 parent ad4eb6d commit f97a683

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

build.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,5 @@ const COMMANDS: &[&str] = &[
77
];
88

99
fn main() {
10-
tauri_plugin::Builder::new(COMMANDS)
11-
.global_api_script_path("./src/polyfill.js")
12-
.build();
10+
tauri_plugin::Builder::new(COMMANDS).build();
1311
}

src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ struct MidiState {
2323
type State = Arc<Mutex<MidiState>>;
2424

2525
const PLUGIN_NAME: &str = "midi";
26+
const RUNTIME_POLYFILL: &str = include_str!("polyfill.js");
2627

2728
fn get_inputs(midi_in: &midir::MidiInput) -> Result<Vec<String>, String> {
2829
midi_in
@@ -196,6 +197,7 @@ pub fn init<R: Runtime>() -> TauriPlugin<R> {
196197

197198
Builder::new(PLUGIN_NAME)
198199
.invoke_handler(builder.invoke_handler())
200+
.js_init_script(RUNTIME_POLYFILL.into())
199201
.setup(move |app, _| {
200202
app.manage(State::default());
201203

0 commit comments

Comments
 (0)