1. 在react根项目中,创建jsconfig.json
{
"compilerOptions":{
"baseUrl":"src" //src为绝对根目录
},
"include":[
"src"
]
}
2. 使用:
const path=window.require('path');
const exePath=path.join('src','**/*.exe'); //获取根目录
1. 在react根项目中,创建jsconfig.json
{
"compilerOptions":{
"baseUrl":"src" //src为绝对根目录
},
"include":[
"src"
]
}
2. 使用:
const path=window.require('path');
const exePath=path.join('src','**/*.exe'); //获取根目录