Skip to content

Commit 0630a14

Browse files
author
himaniraghav3
committed
PM-218 Fix DOS issues with fs
1 parent 38e5efd commit 0630a14

File tree

5 files changed

+5
-8
lines changed

5 files changed

+5
-8
lines changed

config/env.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ dotenvFiles.forEach(dotenvFile => {
4949
// Otherwise, we risk importing Node.js core modules into an app instead of Webpack shims.
5050
// https://github.com/facebook/create-react-app/issues/1023#issuecomment-265344421
5151
// We also resolve them to make sure all tools using them work consistently.
52-
const appDirectory = fs.realpathSync(process.cwd())
52+
const appDirectory = process.cwd()
5353
process.env.NODE_PATH = (process.env.NODE_PATH || '')
5454
.split(path.delimiter)
5555
.filter(folder => folder && !path.isAbsolute(folder))

config/paths.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const url = require('url')
66

77
// Make sure any symlinks in the project folder are resolved:
88
// https://github.com/facebook/create-react-app/issues/637
9-
const appDirectory = fs.realpathSync(process.cwd())
9+
const appDirectory = process.cwd()
1010
const resolveApp = relativePath => path.resolve(appDirectory, relativePath)
1111

1212
const envPublicUrl = process.env.PUBLIC_URL

config/webpack.config.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,6 @@ const shouldUseSourceMap = process.env.GENERATE_SOURCEMAP !== 'false'
2727
// makes for a smoother build process.
2828
const shouldInlineRuntimeChunk = process.env.INLINE_RUNTIME_CHUNK !== 'false'
2929

30-
// Check if TypeScript is setup
31-
const useTypeScript = fs.existsSync(paths.appTsConfig)
32-
3330
// style files regexes
3431
const cssRegex = /\.css$/
3532
const cssModuleRegex = /\.module\.css$/
@@ -257,7 +254,7 @@ module.exports = function (webpackEnv) {
257254
// for React Native Web.
258255
extensions: paths.moduleFileExtensions
259256
.map(ext => `.${ext}`)
260-
.filter(ext => useTypeScript || !ext.includes('ts')),
257+
.filter(ext => !ext.includes('ts')),
261258
alias: {
262259
// Support React Native Web
263260
// https://www.smashingmagazine.com/2016/08/a-glimpse-into-the-future-with-react-native-for-web/

scripts/build.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ const printBuildError = require('react-dev-utils/printBuildError')
2828
const measureFileSizesBeforeBuild =
2929
FileSizeReporter.measureFileSizesBeforeBuild
3030
const printFileSizesAfterBuild = FileSizeReporter.printFileSizesAfterBuild
31-
const useYarn = fs.existsSync(paths.yarnLockFile)
31+
const useYarn = false
3232

3333
// These sizes are pretty large. We'll warn for bundles exceeding them.
3434
const WARN_AFTER_BUNDLE_GZIP_SIZE = 512 * 1024

scripts/start.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ const paths = require('../config/paths')
3232
const configFactory = require('../config/webpack.config')
3333
const createDevServerConfig = require('../config/webpackDevServer.config')
3434

35-
const useYarn = fs.existsSync(paths.yarnLockFile)
35+
const useYarn = true
3636
const isInteractive = process.stdout.isTTY
3737

3838
// Warn and crash if required files are missing

0 commit comments

Comments
 (0)