How to explicitly ignore an unrelated subfolder during the build process

Hi there,

How do I instruct expo to ignore a specific subfolder and all of its contents when building the web app?

We have recently consolidated our backend php codebase and the react native web codebase into one repo. Ideally the repo would have two subfolders - one for react code and the other for the php code. For reasons out of my control, we first need to move the php app into a subfolder of the react app.

ie.

# expo files and folders ...
/src
/node_modules
/ios
/android
package.json

# and then this folder for the php app ...
/web # <- 

Before doing this running build expo:web worked fine.

But after we can’t build because it seems expo is somehow picking up files in the /web directory. It errors with ‘Cannot read property ‘toLowerCase’’ when running optimize-css-assets-webpack-plugin.

Deleting the /web folder results in the build working fine.

How do I explicitly make expo ignore the web/ folder and all of its contents?

Any help would be greatly appreciated.

Expo CLI 4.11.0 environment info:
    System:
      OS: macOS 11.2.3
      Shell: 5.8 - /bin/zsh
    Binaries:
      Node: 14.17.6 - /opt/homebrew/opt/node@14/bin/node
      npm: 6.14.15 - /opt/homebrew/opt/node@14/bin/npm
      Watchman: 2021.08.23.00 - /opt/homebrew/bin/watchman
    Managers:
      CocoaPods: 1.10.2 - /opt/homebrew/bin/pod
    SDKs:
      iOS SDK:
        Platforms: iOS 14.5, DriverKit 20.4, macOS 11.3, tvOS 14.5, watchOS 7.4
      Android SDK:
        API Levels: 29
        Build Tools: 29.0.2, 31.0.0
        System Images: android-29 | Intel x86 Atom, android-29 | Google APIs ARM 64 v8a
    IDEs:
      Android Studio: 4.2 AI-202.7660.26.42.7486908
      Xcode: 12.5/12E262 - /usr/bin/xcodebuild
    npmPackages:
      @expo/webpack-config: ~0.14.0 => 0.14.0
      expo: ^42.0.0 => 42.0.3
      react: 17.0.1 => 17.0.1
      react-dom: 17.0.1 => 17.0.1
      react-native: 0.64.1 => 0.64.1
      react-native-web: ~0.17.1 => 0.17.1
    npmGlobalPackages:
      expo-cli: 4.11.0
    Expo Workflow: bare

I’ve also tried renaming /web to something random like /lalala and the build runs fine. So this suggests that the presence of the subfolder isn’t the problem, but its name. Is /web a reserved name in expo?

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.