I am currently writing a bokeh application where I use a bunch of CustomJS as callbacks. In these call-backs I use a bunch of the same functions. So I would like to save them in a js and I would like to import them into my callbacks.
So what I do is
import { a } from './b.js'
And I receive the following output in my JS console in the browser:
SyntaxError: Unexpected token '{'. import call expects exactly one argument.
JS import/require functionality is a constantly changing mess with different support on different platforms, and I would strongly advise against attempting to use it in a code that’s not going through any compilation step.
The simplest option in your case is to create a global JS object in b.js and use that object and its methods in all relevant CustomJS code.