Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I change `src` folder to something else in create-react-app

I'd like to know if it's possible using react-script to rename src to something else like app folder

like image 862
rstormsf Avatar asked Jun 09 '17 03:06

rstormsf


People also ask

How do I change the path in React project?

How can I change ReactJS project(folder) name, simply rename the folder name from routing (folder) to react-routing-example (folder).

What is src folder in React?

src(folder) In simplest form it's our react app folder i.e. containing components, tests, css files etc.


1 Answers

You can use react-app-rewired to override react paths configuration. In my case, I can change the paths in config-overrides.js file

const path = require('path');  module.exports = {     paths: function (paths, env) {                 paths.appIndexJs = path.resolve(__dirname, 'mysrc/client.js');         paths.appSrc = path.resolve(__dirname, 'mysrc');         return paths;     }, } 
like image 153
Cong Dan Luong Avatar answered Sep 22 '22 11:09

Cong Dan Luong