I am attempting to export an object from my foreground.js script (aka content script) and then import it into my main.js script. This will then be passed as a prop to App.svelte.
Currently, I am exporting the objects from foreground as follows:
export let myData = {}I am then importing it into main.js as follows:
import { myData } from './foreground.js'However, upon activating the extension, I get the error:
Uncaught SyntaxError: Unexpected token 'export'which points to the export line in foreground.js above.
How can I share the variable to main.js (or App.svelte)?
Note that I cannot add main.js to the manifest.json and use messages because Svelte is compiling main.ts, so that file will not "exist" in the dist folder (except in a compiled format).
But I cannot figure out why Chrome is throwing the export error in foreground.js! It supports ES6 does it not??
Thank you in advance.
--
You received this message because you are subscribed to the Google Groups "Chromium Extensions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extens...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-extensions/1e9627b2-1967-4112-b65d-4f8d34a60763n%40chromium.org.