Questions tagged [react-app-rewired]

a tool that allows for easy overriding of create-react-app webpack configs without having to eject

88 questions
1
vote
0 answers

react-app-rewired, transformIgnorePatterns on Apollo Client 3

I have a React app with: react-app-rewired Apollo Client 3.5.5 I have an error when I try to use this import: import { MockedProvider } from '@apollo/client/testing'; If I do console.log(MockedProvider) I got: undefined. If in my jest config I…
pmiranda
  • 7,602
  • 14
  • 72
  • 155
1
vote
1 answer

webpack css-loader removing leading slash in url()

I have a path set in a scss file to a resource I need referenced off the root of the domain. The problem is css-loader removes the leading slash during build, even with the option { url: false }. url('/path/to/file') -> url('path/to/file') Any…
Drazen Bjelovuk
  • 5,201
  • 5
  • 37
  • 64
1
vote
1 answer

Wrong URL imports for @sentry library in a React Rewired App

I currently have a React Rewired App with Typescript which is compiling but has 3 errors that I can't manage to resolve due to being from the node_modules folders. Compiled with problems:X ERROR in…
Raül
  • 137
  • 3
  • 15
1
vote
1 answer

How Can I Configure Storybook to Use React-App-Rewired?

I'm working on a project that implements react-app-rewired to send headers to the server in order to bypass ReferenceError: SharedArrayBuffer is not defined (I'm getting this error from using the @ffmpeg/ffmpeg library). // config-overrides.js const…
1
vote
1 answer

How to configure react-app-rewired to add a postcss plugin

How can I customize react-app-rewired config in CRA v5 to add a postcss plugin, for example this one? I checked react-app-rewired documentation and github issues, but didn't find out how to do that.
Matt
  • 8,195
  • 31
  • 115
  • 225
1
vote
1 answer

How to add less-loader to react-app-rewired config?

I am using react-app-rewired and I want to add the less-loader to the config-overides.js but it doesn't work, I tried with module.exports = { module: { rules: [ { test: /\.less$/i, loader: [ // compiles Less to…
GisCat
  • 55
  • 2
  • 13
1
vote
1 answer

Automatically modify webpack.config.js of react-scripts

I'm running a project by React, "@codingame/monaco-languageclient": "^0.17.3", "monaco-editor": "^0.31.1" and "react-monaco-editor": "^0.35.0". The compiling gave the following error: Failed to…
SoftTimur
  • 5,630
  • 38
  • 140
  • 292
1
vote
0 answers

react build failed, The 'compilation' argument must be an instance of Compilation

npm start is working fine but when I am trying to build with npm run build, compilation failed with this error Creating an optimized production build... Failed to compile. The 'compilation' argument must be an instance of…
Harun-Ur-Rashid
  • 3,338
  • 1
  • 15
  • 22
1
vote
0 answers

Several deprecation warnings in create react app project with react-app-rewired customizations

In our project, we are using monorepo and we had to use react-app-rewired to customize some of the webpack configs without ejecting. Now I am getting 3 deprecation warnings and I can't find anything related to them in the code. I assume that these…
Shurik Agulyansky
  • 2,607
  • 2
  • 34
  • 76
1
vote
1 answer

Override CRA webpack config without ejecting (remove random numbers from media files)

I need to remove generated random numbers from all pdf files names in my project. (for example license.pdf instead of license.3402bc5d.pdf) I tried to use react-app-rewired. file config-overrides.js: module.exports = function override(config, env)…
1
vote
0 answers

react-app-rewired build with GENERATE_SOURCEMAP=false throws cannot find module

Title explains the most of it. I have a react project using react-app-rewired. On production build using GENERATE_SOURCEMAP=false it fails to compile with the error: Cannot find module: '@rewiredlocation'. Make sure this package is installed. This…
Marc
  • 25
  • 5
1
vote
0 answers

react-app-rewired production build failed This probably means the system ran out of memory

"scripts": { "start": "PORT=4001 react-app-rewired start", "build": "export NODE_OPTIONS='--openssl-legacy-provider'; react-app-rewired --max_old_space_size=8096 build", "test": "react-app-rewired --env=jsdom" }, I am using…
1
vote
1 answer

Set multiple entries using react-app-rewired

Below are some options from an open-webpack (not CRA) react project: // webpack.config.js module.exports = { // ... entry: { main: './src/index.js', 'editor.worker': 'monaco-editor/esm/vs/editor/editor.worker.js', …
Mir-Ismaili
  • 13,974
  • 8
  • 82
  • 100
1
vote
0 answers

React - Change static folder path in build directory

I am trying to move static folder in build/ to another directory using react-app-rewired. The final result should be build/assets/static. I am stuck for an hours on this one. My config-overrides.js is the following: module.exports = function…
1
vote
1 answer

What is the correct syntax for adding the xframe header module to cra rewired?

I'm trying to return the X-Frame-Options in my create react app (rewired) but I'm not sure of the correct syntax to use to add the function to my existing override. How do I do this properly? module.exports = override( …
Ayrad
  • 3,996
  • 8
  • 45
  • 86