From 9d14fe60f06e31572cfaf9828f031089b44a692a Mon Sep 17 00:00:00 2001 From: Sambo Chea Date: Wed, 5 Jan 2022 14:48:18 +0700 Subject: [PATCH] Upgrade craco, craco-less, create react app and typescript and updated configs --- craco.config.js | 13 +++++-------- package.json | 8 ++++---- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/craco.config.js b/craco.config.js index 5dad72a..586353a 100644 --- a/craco.config.js +++ b/craco.config.js @@ -31,14 +31,11 @@ module.exports = { plugins: { add: [ new webpack.DefinePlugin({ - 'process.env': { - PACKAGE_NAME: `"${npmPackage.name}"`, - PACKAGE_VERSION: - '"' + npmPackage.version + '-' + dateVersion + '"', - BUILD_NUMBER: '"' + uuidv4() + '"', - BUILD_DATE: '"' + today.toLocaleString() + '"', - COMMIT_ID: '"' + fetchGitCommitId() + '"', - }, + 'process.env.PACKAGE_NAME': `"${npmPackage.name}"`, + 'process.env.PACKAGE_VERSION': `"${dateVersion}"`, + 'process.env.BUILD_NUMBER': `"${uuidv4()}"`, + 'process.env.BUILD_DATE': `"${today.toLocaleString()}"`, + 'process.env.COMMIT_ID': `"${fetchGitCommitId()}"`, }), ], }, diff --git a/package.json b/package.json index d6a4d10..a33423b 100644 --- a/package.json +++ b/package.json @@ -43,7 +43,7 @@ ] }, "devDependencies": { - "@craco/craco": "^6.1.2", + "@craco/craco": "^6.4.3", "@testing-library/jest-dom": "^5.11.4", "@testing-library/react": "^11.1.0", "@testing-library/user-event": "^12.1.10", @@ -52,9 +52,9 @@ "@types/react": "^17.0.0", "@types/react-dom": "^17.0.0", "@types/react-router-dom": "^5.1.7", - "craco-less": "^1.17.1", + "craco-less": "^2.0.0", "prettier": "^2.3.1", - "react-scripts": "4.0.3", - "typescript": "^4.1.2" + "react-scripts": "5.0.0", + "typescript": "^4.5.4" } }