craco | Create React App Configuration Override | Frontend Framework library
kandi X-RAY | craco Summary
kandi X-RAY | craco Summary
Create React App Configuration Override is an easy and comprehensible configuration layer for create-react-app. Get all the benefits of create-react-app and customization without using 'eject' by adding a single configuration (e.g. craco.config.js) file at the root of your application and customize your eslint, babel, postcss configurations and many more. All you have to do is create your app using create-react-app and customize the configuration file.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Updates the configuration with the given configuration .
- Creates a babel transformer
- Extend postcss to add plugins
- Remove a loader recursively .
- Creates a dev server based on the browser configuration .
- Override the eslint config .
- Extend plugin config .
- Creates a new Webpack configuration .
- Overrides the css config with the given CSS module .
- Merge cordova configuration into runner configuration .
craco Key Features
craco Examples and Code Snippets
Community Discussions
Trending Discussions on craco
QUESTION
I want to use Tailwind CSS for my react apps. The problem is CRACO start
starts the app on the default port, which is 3000 and I want to have custom ports but I can't figure out what is the right approach. ( Can't find anything about this in their documentation )
I tried something like PORT=5000 CRACO start
inside the scripts
field of the package.json
file but doesn't work.
Any idea?
ANSWER
Answered 2021-Nov-20 at 20:31CRACO use the webpack devserver configuration to set the port.
you need to create a configuration. read more here in the readme:
https://github.com/gsoft-inc/craco/blob/master/packages/craco/README.md#configuration-file
So you solution need to redefine devServer
. How to define it read in the webpack documentation:
QUESTION
Edit: This issue is now deprecated since version 3.0.0 of tailwind works with react without having to use CRACO.
While trying to use Tailwind with React in JIT mode the classes that I add have no styles, even after refreshing the page. I have to restart the server for the styles to take effect.
tailwind.config.js:
...ANSWER
Answered 2021-Nov-05 at 14:41In package.json
you should activate watch mode on the start script like
QUESTION
never use npm raw command in meteor. always meteor npm. That is the reason why everything broke.
AND do upgrade step by step , version to the nearest version.
I think that's all that causes this headache.
Everything works now.
Thanks !
EDIT :After trying all the steps ahead ... I remove jquery / less and semantic:ui from meteor
...ANSWER
Answered 2022-Feb-28 at 21:21I think you have created a bit of a mess for yourself. I was able to create a simple meteor app using semantic-ui-react as follows:
QUESTION
I am trying to use tailwindCSS in a ReactJS app
These are the scripts commands in package.json
file
ANSWER
Answered 2021-Dec-18 at 22:00It looks like the Tailwind configuration from CRACO is not needed anymore.
https://github.com/facebook/create-react-app/issues/11771#issuecomment-997217680
Look at Tailwind 3.0 install steps: https://tailwindcss.com/docs/guides/create-react-app
QUESTION
After upgrading react-scripts to v5, craco start
does not work properly. App starts with no error but in browser, there is a blank page and if i open inspector, i only see index.html codes not react codes. It was working well with react-scripts@4.0.3. Here is my local files;
package.json
...ANSWER
Answered 2022-Feb-23 at 10:05craco
's Github readme, states that it is supporting Create React App (CRA) 4.*
. By this statement, I'm assuming CRA 5
is not officially supported by craco
.
However, this repository utilizes both CRA 5
and craco
(but I have not verified that it is working). Use this repository to compare your setup (after verifying that the linked repositry is working), and try different settings/configs to see if you get further.
QUESTION
I've recently switched my CRA dictionary application to Preact using craco. I've made this work using webpack aliases, which replace references to react packages with preact packages (e.g. preact/compat
).
craco build
I get no errors and the build successfully completes, and you can see the folder here:
Everything fine here.
craco start
It starts the predeployment checks (I think), and hits a snag very quickly. It can't find the react module.
...ANSWER
Answered 2022-Feb-16 at 16:40You need to keep react
installed, unfortunately. It's required by react-scripts
for starting the dev server and is unavoidable without forking the package.
If you're concerned about the alias working with React still being installed, you can comment out your config and compare build sizes. You should see a sizable difference, confirming your alias works as intended.
QUESTION
ANSWER
Answered 2022-Feb-03 at 03:13https://webpack.js.org/configuration/stats/
There are a ton of logging options you can use with devServer:
QUESTION
I have a react app made with create react app, and hot reloading kills the page entirely with the error:
...ANSWER
Answered 2021-Dec-15 at 22:41I fixed it. I did 2 things:
- Updated npm to latest
- Updated react-scripts to latest
Not sure which one fixed it.
QUESTION
I have a react application that was created with create-react-app and is using react-scripts version 3.4.2. The app works great but when I run eslint against it I get many invalid no-unused-vars errors. By invalid I mean that when I go to the file that variable is actually being used.
Based on this answer it seems the issue is related to @typescript-eslint/parser and @typescript-eslint/eslint-plugin. So I went ahead and executed npm list @typescript-eslint/parser @typescript-eslint/eslint-plugin
on my app and this is what I get:
ANSWER
Answered 2022-Jan-26 at 12:15The error message that you shared seems to be related to a bug with react-error-overlay
.
react-scripts
4.0.3. uses react-error-overlay
6.0.9. However, 6.0.10 is marked as a patch, so npm uses 6.0.10 instead of 6.0.9, but 6.0.10 is not compatible with 6.0.9.
On the other hand, react-scripts
5 does not use react-error-overlay
, but might be causing breaking changes with your other packages, hence the other errors.
You can find more information about the react-error-overlay
bug in these issues on the CRA repository:
- Hot Reload Fails, DOM adds an additional iframe containing entire contents of the html DOM element #11880
- Is this the bug of react-error-overlay? #11773
- v5 Regression react-error-overlay build - Uncaught ReferenceError: process is not defined #11771
Here's a possible solution with react-scripts
4.0.3.:
- In your project's
package.json
file:
- In
dependencies
, set thereact-scripts
version to 4.0.3. - Under
dependencies
, inresolutions
, addreact-error-overlay
6.0.9. - In
devDependencies
, addreact-error-overlay
6.0.9.
QUESTION
My project keeps getting the error PostCSS plugin tailwindcss requires PostCSS 8
when npm start
.
This case is the same, but now it's old and nothing works. PostCSS 8 now should be compatible with Tailwind and CRA, so I installed the latest versions but returns the same error. I got stuck here for almost 3days, so I'd appreciate any suggestions or comments!
What I tried (but never worked):
- Downgraded to compatible versions of
tailwindcss/postcss7-compat": "^2.2.17”
,PostCSS ^7.0.39
andautoprefixer": "^9.8.8
- Upgraded to the latest version of
tailwindcss:"^2.2.17"
,autoprefixer:"^10.4.0"
, andPostCSS ^8.3.11
- Upgraded
node v16.13.0
,craco: "^6.4.0"
, andreact-scripts:"^4.0.3"
. - Added
--openssl-legacy-provider
in start script - Deleted package-lock.json, yarn-lock.json, node-modules, and
npm install
- Restarted VScode and browser multiple times.
ANSWER
Answered 2021-Nov-01 at 06:31I spent so much time on this and finally found a workaround.
Use tailwind CLI instead of postCSS and autoprefixer. Follow this doc. Don't forget to remove require('autoprefixer')
from the craco.config.js.
PostCSS official says that PostCSS8 is now compatible with create-react-app, but unfortunately not.
I saw many people are still having the same problem as me, so I hope this answer helps someone.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install craco
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page