Skip to content
This repository has been archived by the owner on Jan 18, 2024. It is now read-only.

Please upgrade @expo/webpack-config's webpack dependency to 5.x #2881

Closed
andymatuschak opened this issue Nov 13, 2020 · 8 comments · Fixed by #3763
Closed

Please upgrade @expo/webpack-config's webpack dependency to 5.x #2881

andymatuschak opened this issue Nov 13, 2020 · 8 comments · Fixed by #3763
Assignees
Labels
blocked Pull request is blocked by another PR enhancement New feature or request Platform: web Using Expo in the browser

Comments

@andymatuschak
Copy link

Description

@expo/webpack-config's webpack dependency is currently 4.43.0, the last major version. The current major version is 5.x, and it'd be great to support that: I'd like to be able to take advantage of some of the changes in recent releases.

Expected Behavior

@expo/webpack-config should depend on webpack@5

Observed Behavior

@expo/webpack-config depends on webpack@4.43.0

Environment

I don't think this is relevant, but here you are!

Expo CLI 3.28.5 environment info:
    System:
      OS: macOS 10.15.7
      Shell: 5.7.1 - /bin/zsh
    Binaries:
      Node: 12.18.4 - ~/.nvm/versions/node/v12.18.4/bin/node
      Yarn: 1.22.5 - /usr/local/bin/yarn
      npm: 6.14.6 - ~/.nvm/versions/node/v12.18.4/bin/npm
      Watchman: 4.9.0 - /usr/local/bin/watchman
    Managers:
      CocoaPods: 1.9.3 - /usr/local/bin/pod
    SDKs:
      iOS SDK:
        Platforms: iOS 14.1, DriverKit 19.0, macOS 10.15, tvOS 14.0, watchOS 7.0
    IDEs:
      Android Studio: 4.0 AI-193.6911.18.40.6626763
      Xcode: 12.1/12A7403 - /usr/bin/xcodebuild
    npmPackages:
      react: ~17.0.1 => 17.0.1 
    Expo Workflow: managed
@EvanBacon
Copy link
Contributor

Looks like it's not ready yet, there's a lot of overlap between CRA and expo/webpack-config, a couple of the plugins don't appear to support Webpack 5 properly yet facebook/create-react-app#7929

@EvanBacon EvanBacon added the blocked Pull request is blocked by another PR label Nov 16, 2020
@nandorojo
Copy link

Webpack 5 doesn't seem fully there yet, but Next.js has experimental support for it: https://nextjs.org/docs/messages/webpack5

@nandorojo
Copy link

nandorojo commented Apr 12, 2021

I'd like to bring this issue back up. Vercel is putting real resources behind Webpack 5, and Next is releasing many advances for it. It has many performance improvements that would be nice to take advantage of for build time. Maybe it could be published behind a next tag?

@nandorojo
Copy link

Possibly related: #3226

@nandorojo
Copy link

Next.js now uses webpack 5 by default. https://nextjs.org/blog/next-10-2#webpack-5

This has big DX improvements for web.

Does anyone know how to make Expo's webpack config do the same? I'm open to helping, but I'm not really familiar with Webpack.

@nandorojo
Copy link

I believe I figured this out. I'll submit a PR once I stress test it more.

As it stands, my solution is to disable Expo's transpiling of modules when webpack5: true. In those cases, you'd need to use next-transpile-modules. For instance, you'd add react-native-web to your next-transpile-modules array, along with other expo-* packages.

@marklawlor
Copy link
Contributor

marklawlor commented May 13, 2021

Building upon @nandorojo's work, I have an experimental version of @expo/next-adapter which includes a couple of patches to @expo/webpack-config to allow for webpack 5 support

This won't work for the pure Expo web applications, but if your using NextJS it should allow you to update to NextJS 10.2 and use Webpack5.

https://github.com/marklawlor/expo-nextjs-webpack-5

@csvan
Copy link

csvan commented Dec 22, 2022

This has severe implications for users of Node 17 and later, see webpack/webpack#14532

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
blocked Pull request is blocked by another PR enhancement New feature or request Platform: web Using Expo in the browser
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants