Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: resolve dependency issues in v5 alpha #11294

Merged
merged 3 commits into from
Sep 22, 2021

Conversation

merceyz
Copy link
Contributor

@merceyz merceyz commented Aug 7, 2021

What's the problem this PR addresses?

The v5 alpha regressed to have dependency issues.

How did you fix it?

  • Resolve webpack loaders
  • Declare terser-webpack-plugin as a dependency again
  • Resolve @babel/runtime from babel-preset-react-app

@raix
Copy link
Contributor

raix commented Aug 18, 2021

Terser is shipped in webpack 5 not sure this is the way to go?

@merceyz
Copy link
Contributor Author

merceyz commented Aug 18, 2021

It's required by react-scripts so it has to declare it as a dependency

const TerserPlugin = require('terser-webpack-plugin');

@raix
Copy link
Contributor

raix commented Aug 18, 2021

I'll have to check, anyways we should use the terser plug-in already available in webpack 5 https://webpack.js.org/plugins/terser-webpack-plugin/

@raix
Copy link
Contributor

raix commented Aug 18, 2021

(Adding the terser dependency is webpack 4 style...)

@raix
Copy link
Contributor

raix commented Aug 18, 2021

That said, I've seen a warning from babel when the babel cache is empty, so the config has an issue

@merceyz
Copy link
Contributor Author

merceyz commented Sep 2, 2021

anyways we should use the terser plug-in already available in webpack 5 https://webpack.js.org/plugins/terser-webpack-plugin/

Those docs also specify to declare it as a dependency

if you are using Webpack v5 or above and wish to customize the options, you will still need to install terser-webpack-plugin.

@raix
Copy link
Contributor

raix commented Sep 3, 2021

@merceyz you are right 👍 - I completely missed that detail
Seems like tests are failing, we could try mergning latest main to see if it resolves the issue

@raix raix added this to the 5.0 milestone Sep 3, 2021
@merceyz merceyz force-pushed the merceyz/fix/dependency-issues branch from 2d3daeb to 80b8a29 Compare September 3, 2021 09:41
abhiisheek pushed a commit to abhiisheek/create-react-app that referenced this pull request May 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants