Hello everybody, I’m having downside utilizing internet employee in cocos.
I’ve file a.ts and file employee.ts. How am i able to import file a.ts into employee.ts ? I attempt to use importScripts(a.js) but it surely’s not work as a result of importScripts will not be outlined.
I could be off with what you’re asking however if you wish to import one other script I’ve achieved it like this.
import { yourscript } from './a';
Then you possibly can name like:
yourscript.someVariable
I’ve file primary.ts like this
import MyWorker from `../MyWorker'
const code = MyWorker.toString();
const blob = new Blob([`(${code})()`]);
const employee = new Employee(URL.createObjectURL(blob));
file MyWorker like this
import AnotherFile from '.../AnotherFile';
export default () => {
console.log(take a look at, AnotherFile); // error right here
};