I am using ES2015 Import / Export modules.
In my worker file, when I try to import functions like I normally do:
worker.js
i
for me assigning to self. worked well.
I've put import to another js file: abcImported.js
import { a, b, c } from "./abc.js";
export { a, b, c };
and in the service worker:
self.a = require('abcImported.js').a;
self.b = require('abcImported.js').b;
in this way, it is accessible inside the worker. (tested in chrome)