We’re building an Expo mobile app and a companion browser extension.
The extension will re-use most of the code. However, there are a couple of browser extension specific scripts, like the ./web/background.js
file.
With the default expo webpack config, the ./web/background.js
file gets ONLY copied over the ‘web-build’ directory. However, I want to include it in the webpack compilation process, so that:
-
In
./web/background.js
I can import other modules (fromnode_modules
and from the./src
folder). -
Have this single file compiled to
./web-build/background.bundle.js
, so we can reference it in the browser extension custom manifest file.
Can you please advice me how to leverage the @expo/webpack-config to achieve that?