diff --git a/.github/actions/setup-project/action.yml b/.github/actions/setup-project/action.yml index 00e0673..ef3ec83 100644 --- a/.github/actions/setup-project/action.yml +++ b/.github/actions/setup-project/action.yml @@ -36,3 +36,13 @@ runs: run: bun install working-directory: webui shell: bash + + - name: ♻️ Restore webui cache + if: ${{ inputs.with-webui == 'true' }} + uses: actions/cache@v4 + with: + key: webui-metro-${{ runner.os }}-${{ github.sha }} + restore-keys: | + webui-metro-${{ runner.os }} + path: | + webui/node_modules/.cache/metro diff --git a/webui/metro.config.js b/webui/metro.config.js index 5ae8cb1..f400074 100644 --- a/webui/metro.config.js +++ b/webui/metro.config.js @@ -1,4 +1,5 @@ const { getDefaultConfig } = require('expo/metro-config'); +const { FileStore } = require('metro-cache'); const { withNativeWind } = require('nativewind/metro'); const path = require('path'); @@ -6,6 +7,12 @@ const config = withNativeWind(getDefaultConfig(__dirname), { input: './src/styles.css', }); +// Allow Metro to access the `~plugin/**` files config.watchFolders = [__dirname, path.resolve(__dirname, '..')]; +// Move the Metro cache to `node_modules/.cache` +config.cacheStores = [ + new FileStore({ root: path.join(__dirname, 'node_modules', '.cache', 'metro') }), +]; + module.exports = config;