如何在create-react-app中将`src`文件夹更改为其他内容 [英] How do I change `src` folder to something else in create-react-app
本文介绍了如何在create-react-app中将`src`文件夹更改为其他内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想知道是否可以使用react-script
将src
重命名为app
文件夹之类的
I'd like to know if it's possible using react-script
to rename src
to something else like app
folder
推荐答案
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;
},
}
这篇关于如何在create-react-app中将`src`文件夹更改为其他内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文