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

CRA v4 switch from GenerateSW to InjectManifest not supported - workaround #306

Open
nealeu opened this issue Aug 10, 2021 · 0 comments
Open

Comments

@nealeu
Copy link

nealeu commented Aug 10, 2021

In facebook/create-react-app#9205, they switched to InjectManifest, yet at https://github.com/arackaf/customize-cra/blob/master/src/customizers/webpack.js#L64 we have

export const adjustWorkbox = adjust => config => {
  config.plugins.forEach(p => {
    if (p.constructor.name === "GenerateSW") {
      adjust(p.config);
    }
  });
  return config;
};

This needs amending to support adjusting the InjectManifest config which people needing to work around this issue can do by using the following code locally instead of importing adjustWorkbox:

export const adjustWorkbox = adjust => config => {
  config.plugins.forEach(p => {
    if (p.constructor.name === "InjectManifest") {
      adjust(p.config);
    }
  });
  return config;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant