update dynamic underpath
This commit is contained in:
2
.env
2
.env
@ -1,2 +1,2 @@
|
|||||||
REACT_APP_BASE_URL=/dashboard
|
REACT_APP_BASE_URL=/dashboard
|
||||||
REACT_APP_API_URL=https://tpay.shiblysolution.id/api/
|
REACT_APP_API_URL=https://tpay.shiblysolution.id/api/
|
||||||
|
|||||||
34231
package-lock.json
generated
34231
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
117
package.json
117
package.json
@ -1,58 +1,61 @@
|
|||||||
{
|
{
|
||||||
"name": "new-tpay",
|
"name": "new-tpay",
|
||||||
"version": "0.1.0",
|
"version": "0.1.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@emotion/react": "^11.14.0",
|
"@emotion/react": "^11.14.0",
|
||||||
"@emotion/styled": "^11.14.0",
|
"@emotion/styled": "^11.14.0",
|
||||||
"@mui/icons-material": "^6.2.1",
|
"@mui/icons-material": "^6.2.1",
|
||||||
"@mui/material": "^6.2.1",
|
"@mui/material": "^6.2.1",
|
||||||
"@reduxjs/toolkit": "^2.5.0",
|
"@reduxjs/toolkit": "^2.5.0",
|
||||||
"@testing-library/jest-dom": "^5.17.0",
|
"@testing-library/jest-dom": "^5.17.0",
|
||||||
"@testing-library/user-event": "^13.5.0",
|
"@testing-library/user-event": "^13.5.0",
|
||||||
"ajv": "^8.17.1",
|
"ajv": "^8.17.1",
|
||||||
"ajv-keywords": "^5.1.0",
|
"ajv-keywords": "^5.1.0",
|
||||||
"axios": "^1.7.9",
|
"axios": "^1.7.9",
|
||||||
"chart.js": "^4.4.7",
|
"chart.js": "^4.4.7",
|
||||||
"js-cookie": "^3.0.5",
|
"dotenv": "^16.4.7",
|
||||||
"react": "^18.3.1",
|
"js-cookie": "^3.0.5",
|
||||||
"react-chartjs-2": "^5.2.0",
|
"react": "^18.3.1",
|
||||||
"react-circular-progressbar": "^2.1.0",
|
"react-chartjs-2": "^5.2.0",
|
||||||
"react-dom": "^18.3.1",
|
"react-circular-progressbar": "^2.1.0",
|
||||||
"react-redux": "^9.2.0",
|
"react-dom": "^18.3.1",
|
||||||
"react-router-dom": "^7.1.1",
|
"react-redux": "^9.2.0",
|
||||||
"react-scripts": "5.0.1",
|
"react-router-dom": "^7.1.1",
|
||||||
"redux": "^5.0.1",
|
"react-scripts": "5.0.1",
|
||||||
"web-vitals": "^2.1.4"
|
"redux": "^5.0.1",
|
||||||
},
|
"web-vitals": "^2.1.4"
|
||||||
"scripts": {
|
},
|
||||||
"start": "react-scripts start eslint-disable-next-line",
|
"scripts": {
|
||||||
"build": "react-scripts build",
|
"prebuild": "node set-homepage.js",
|
||||||
"test": "react-scripts test",
|
"start": "react-scripts start eslint-disable-next-line",
|
||||||
"eject": "react-scripts eject"
|
"build": "react-scripts build",
|
||||||
},
|
"test": "react-scripts test",
|
||||||
"eslintConfig": {
|
"eject": "react-scripts eject"
|
||||||
"extends": [
|
},
|
||||||
"react-app",
|
"eslintConfig": {
|
||||||
"react-app/jest"
|
"extends": [
|
||||||
]
|
"react-app",
|
||||||
},
|
"react-app/jest"
|
||||||
"browserslist": {
|
]
|
||||||
"production": [
|
},
|
||||||
">0.2%",
|
"browserslist": {
|
||||||
"not dead",
|
"production": [
|
||||||
"not op_mini all"
|
">0.2%",
|
||||||
],
|
"not dead",
|
||||||
"development": [
|
"not op_mini all"
|
||||||
"last 1 chrome version",
|
],
|
||||||
"last 1 firefox version",
|
"development": [
|
||||||
"last 1 safari version"
|
"last 1 chrome version",
|
||||||
]
|
"last 1 firefox version",
|
||||||
},
|
"last 1 safari version"
|
||||||
"devDependencies": {
|
]
|
||||||
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
|
},
|
||||||
"@babel/plugin-transform-private-property-in-object": "^7.25.9",
|
"devDependencies": {
|
||||||
"@testing-library/dom": "^10.4.0",
|
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
|
||||||
"@testing-library/react": "^16.1.0"
|
"@babel/plugin-transform-private-property-in-object": "^7.25.9",
|
||||||
}
|
"@testing-library/dom": "^10.4.0",
|
||||||
}
|
"@testing-library/react": "^16.1.0"
|
||||||
|
},
|
||||||
|
"homepage": "/dashboard"
|
||||||
|
}
|
||||||
21
set-homepage.js
Normal file
21
set-homepage.js
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
const fs = require('fs');
|
||||||
|
const path = require('path');
|
||||||
|
const dotenv = require('dotenv');
|
||||||
|
|
||||||
|
// Load environment variables from .env
|
||||||
|
dotenv.config();
|
||||||
|
|
||||||
|
// Get the REACT_APP_BASE_URL from .env
|
||||||
|
const baseUrl = process.env.REACT_APP_BASE_URL || '/';
|
||||||
|
|
||||||
|
// Read the package.json file
|
||||||
|
const packageJsonPath = path.join(__dirname, 'package.json');
|
||||||
|
const packageJson = require(packageJsonPath);
|
||||||
|
|
||||||
|
// Update the homepage field in package.json
|
||||||
|
packageJson.homepage = baseUrl;
|
||||||
|
|
||||||
|
// Write the updated package.json back to the file
|
||||||
|
fs.writeFileSync(packageJsonPath, JSON.stringify(packageJson, null, 2));
|
||||||
|
|
||||||
|
console.log(`Updated homepage to ${baseUrl} in package.json`);
|
||||||
Reference in New Issue
Block a user