I'm creating a Chrome extension with React using CRA.
I want to use some helper functions within the /src
folder inside of the background.js
file, which causes the error Cannot use import statement outside a module
because it's in the public folder.
The background.js
file has to be in the same folder as the manifest.json
file for version 3
of the manifest.json`.
Any suggestions on how to move manifest.json
and background.js
into the /src
folder and still have it build properly with npm run build
, which currently uses react-scripts build
?