-
-
Notifications
You must be signed in to change notification settings - Fork 871
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' of https://github.com/Devesh326/talawa-admin i…
…nto develop
- Loading branch information
Showing
7 changed files
with
45 additions
and
112 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,7 +31,4 @@ yarn-error.log* | |
# express setup | ||
debug.log | ||
|
||
# No editor related files | ||
.idea | ||
.vscode | ||
*.swp | ||
.vscode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,16 @@ | ||
require('dotenv').config(); | ||
const { spawn } = require('child_process'); | ||
|
||
//const react_script_start = 'npx react-scripts start'; | ||
const reactAppRewiredStart = | ||
'npx react-app-rewired start --config-overrides=scripts/config-overrides/'; | ||
const react_script_start = 'npx react-scripts start'; | ||
const react_app_rewired_start = 'npx react-app-rewired start --config-overrides=scripts/config-overrides'; | ||
|
||
if (process.env.ALLOW_LOGS === "YES") { | ||
// Execute the npm command | ||
spawn(react_app_rewired_start, { stdio: 'inherit', shell: true }); | ||
|
||
} | ||
else { | ||
// Execute the npm command | ||
spawn(react_script_start, { stdio: 'inherit', shell: true }); | ||
} | ||
|
||
spawn(reactAppRewiredStart, { stdio: 'inherit', shell: true }); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,68 +1,29 @@ | ||
const { | ||
override, | ||
addWebpackPlugin, | ||
overrideDevServer, | ||
} = require('customize-cra'); | ||
const { override, addWebpackPlugin } = require('customize-cra'); | ||
const webpack = require('webpack'); | ||
const fs = require('fs'); | ||
const evalSourceMapMiddleware = require('react-dev-utils/evalSourceMapMiddleware'); | ||
const noopServiceWorkerMiddleware = require('react-dev-utils/noopServiceWorkerMiddleware'); | ||
const redirectServedPath = require('react-dev-utils/redirectServedPathMiddleware'); | ||
const paths = require('react-scripts/config/paths'); | ||
const isAllowLogEnabled = process.env.ALLOW_LOGS === 'YES'; | ||
module.exports = { | ||
webpack: override( | ||
// Add your new webpack plugin | ||
isAllowLogEnabled && | ||
(addWebpackPlugin( | ||
new webpack.ProgressPlugin({ | ||
activeModules: true, | ||
entries: true, | ||
handler: (percentage, message, ...args) => { | ||
// Log a custom progress message with active module and its count | ||
console.info( | ||
`<Webpack-Progress>: ${Math.floor(percentage * 100)}% ${message}` | ||
); | ||
}, | ||
modules: true, | ||
modulesCount: 5000, | ||
profile: false, | ||
dependencies: true, | ||
dependenciesCount: 10000, | ||
percentBy: null, | ||
}) | ||
), | ||
// Modify infrastructureLogging level | ||
(config) => { | ||
config.infrastructureLogging = { | ||
level: 'verbose', | ||
}; | ||
return config; | ||
}) | ||
), | ||
devServer: overrideDevServer((config) => { | ||
// Remove onAfterSetupMiddleware and onBeforeSetupMiddleware | ||
config.onAfterSetupMiddleware = undefined; | ||
config.onBeforeSetupMiddleware = undefined; | ||
|
||
// Add devServer.setupMiddlewares | ||
config.setupMiddlewares = (middlewares, devServer) => { | ||
if (!devServer) { | ||
throw new Error('webpack-dev-server is not defined'); | ||
} | ||
|
||
if (fs.existsSync(paths.proxySetup)) { | ||
require(paths.proxySetup)(devServer.app); | ||
} | ||
module.exports = override( | ||
// Add your new webpack plugin | ||
addWebpackPlugin(new webpack.ProgressPlugin({ | ||
activeModules: true, | ||
entries: true, | ||
handler: (percentage, message, ...args) => { | ||
// Log a custom progress message with active module and its count | ||
console.info(`<Webpack-Progress>: ${Math.floor(percentage * 100)}% ${message}`); | ||
}, | ||
modules: true, | ||
modulesCount: 5000, | ||
profile: false, | ||
dependencies: true, | ||
dependenciesCount: 10000, | ||
percentBy: null, | ||
})), | ||
|
||
middlewares.push( | ||
evalSourceMapMiddleware(devServer), | ||
redirectServedPath(paths.publicUrlOrPath), | ||
noopServiceWorkerMiddleware(paths.publicUrlOrPath) | ||
// Add your additional middlewares here if needed | ||
); | ||
|
||
return middlewares; | ||
// Modify infrastructureLogging level | ||
(config) => { | ||
config.infrastructureLogging = { | ||
level: 'verbose', | ||
}; | ||
}), | ||
}; | ||
return config; | ||
} | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters