mirror of
https://github.com/streetwriters/notesnook.git
synced 2026-09-01 19:49:54 +02:00
mobile: load async scripts with script manager
This commit is contained in:
@@ -5,4 +5,21 @@ import "./polyfills/console-time.js"
|
||||
global.Buffer = require('buffer').Buffer;
|
||||
import '../app/common/logger/index';
|
||||
import { DOMParser } from './worker.js';
|
||||
import { ScriptManager, Script } from '@callstack/repack/client';
|
||||
global.DOMParser = DOMParser;
|
||||
|
||||
ScriptManager.shared.addResolver(async (scriptId) => {
|
||||
// `scriptId` will be either 'student' or 'teacher'
|
||||
|
||||
// In dev mode, resolve script location to dev server.
|
||||
if (__DEV__) {
|
||||
return {
|
||||
url: Script.getDevServerURL(scriptId),
|
||||
cache: false,
|
||||
};
|
||||
}
|
||||
|
||||
return {
|
||||
url: Script.getFileSystemURL(scriptId)
|
||||
};
|
||||
});
|
||||
@@ -118,6 +118,7 @@
|
||||
"terser-webpack-plugin": "^5.3.5",
|
||||
"ts-jest": "^29.1.1",
|
||||
"webpack-cli": "^5.1.4",
|
||||
"webpack": "^5.88.2"
|
||||
"webpack": "^5.88.2",
|
||||
"acorn-import-attributes": "1.9.5"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user