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

How to Setup in CRA 4.x the documentation has no steps for setting up while using the latest CRA version. #2858

Open
pardhav opened this issue May 2, 2021 · 4 comments

Comments

@pardhav
Copy link

pardhav commented May 2, 2021

No description provided.

@welcome
Copy link

welcome bot commented May 2, 2021

Thanks for opening your first issue! 👋
If you have found this library helpful, please star it. A maintainer will try to respond within 7 days. If you haven’t heard anything by then, please bump this thread.

@no-stack-dub-sack
Copy link
Contributor

Any update on this?

@no-stack-dub-sack
Copy link
Contributor

@pardhav and anyone else who may be struggling with this, the following worked for me using the latest version of CRA:

  1. Follow all the steps in the CRA 2.x guide, but also install react-app-rewire-babel-loader to your dev dependencies
  2. Replace the contents of config-overrides.js with the following:
const path = require("path");
const fs = require("fs");
const rewireBabelLoader = require("react-app-rewire-babel-loader");

const appDirectory = fs.realpathSync(process.cwd());
const resolveApp = (relativePath) => path.resolve(appDirectory, relativePath);

module.exports = function override(config, env) {
  config = rewireBabelLoader.include(
    config,
    resolveApp("node_modules/@salesforce/design-system-react"),
  );

  return config;
};

@stale
Copy link

stale bot commented Apr 18, 2022

This issue has been automatically marked as stale, because it has not had recent activity. It will be closed if no further activity occurs. Maintainers are responsible for tech debt and project health. This is most likely a new components or component feature request. Please submit a pull request for or request feedback on this feature. Thank you.

@stale stale bot added the stale label Apr 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants