1.2.6 • Published 3 years ago
prender-core v1.2.6
react-app-rewired-dynamic
can help you to fetch data before project building and inject data in builded project
just like using react-app-rewired,create config-dynamic.js file to send request and return data what you want
step1 ,create config-dynamic.js
config-dynamic.js
module.exports = async (argvs) => {
let data = await someFetch("http"//...")
return data
}
step2 ,add function in config-overrides
config-overrides.js
const { override } = require("customize-cra");
const { mergeDefine } = require("react-app-rewired-dynamic");
module.exports = override(
mergeDefine({otherStaticData : "hello"})
)
step3, the data you returned will be Assigned to global variable : process.REACT_APP_REWIRED_DYNAMIC
App.jsx
console.log(process.REACT_APP_REWIRED_DYNAMIC)
step4,package.json
"start": "react-app-rewired-dynamic start"
"build": "react-app-rewired-dynamic build"
1.2.6
3 years ago
1.2.5
3 years ago
1.2.2
3 years ago
1.2.1
3 years ago
1.2.0
3 years ago
1.1.1
3 years ago
1.1.9
3 years ago
1.1.8
3 years ago
1.1.7
3 years ago
1.1.6
3 years ago
1.1.5
3 years ago
1.1.4
3 years ago
1.1.3
3 years ago
1.1.2
3 years ago
1.1.12
3 years ago
1.1.11
3 years ago
1.1.10
3 years ago
1.1.0
3 years ago
1.0.2
3 years ago
1.0.1
3 years ago
1.0.0
3 years ago