)\n ]\n }),\n \u002F\u002F TypeScript type checking\n useTypeScript &&\n new ForkTsCheckerWebpackPlugin({\n typescript: resolve.sync('typescript', {\n basedir: paths.appNodeModules\n }),\n async: isEnvDevelopment,\n useTypescriptIncrementalApi: true,\n checkSyntacticErrors: true,\n resolveModuleNameModule: process.versions.pnp\n ? `${__dirname}\u002FpnpTs.js`\n : undefined,\n resolveTypeReferenceDirectiveModule: process.versions.pnp\n ? `${__dirname}\u002FpnpTs.js`\n : undefined,\n tsconfig: paths.appTsConfig,\n reportFiles: [\n '**',\n '!**\u002F__tests__\u002F**',\n '!**\u002F?(*.)(spec|test).*',\n '!**\u002Fsrc\u002FsetupProxy.*',\n '!**\u002Fsrc\u002FsetupTests.*'\n ],\n watch: paths.appSrc,\n silent: true,\n \u002F\u002F The formatter is invoked directly in WebpackDevServerUtils during development\n formatter: isEnvProduction ? typescriptFormatter : undefined\n })\n ].filter(Boolean),\n \u002F\u002F Some libraries import Node modules but don't use them in the browser.\n \u002F\u002F Tell Webpack to provide empty mocks for them so importing them works.\n node: {\n module: 'empty',\n dgram: 'empty',\n dns: 'mock',\n fs: 'empty',\n http2: 'empty',\n net: 'empty',\n tls: 'empty',\n child_process: 'empty'\n },\n \u002F\u002F Turn off performance processing because we utilize\n \u002F\u002F our own hints via the FileSizeReporter\n performance: false\n };\n};\n","directory_shortid":"BkTIAdXfr","id":"0cc03b1d-c67d-45f7-87a0-d2138cb53601","inserted_at":"2019-07-22T18:20:05","is_binary":false,"shortid":"ry2p80OQGB","source_id":"f4383241-686b-4488-b946-849ecc3cadc3","title":"webpack.config.js","updated_at":"2019-07-22T18:20:05","upload_id":null},{"code":"'use strict';\n\nconst { resolveModuleName } = require('ts-pnp');\n\nexports.resolveModuleName = (\n typescript,\n moduleName,\n containingFile,\n compilerOptions,\n resolutionHost\n) =\u003E {\n return resolveModuleName(\n moduleName,\n containingFile,\n compilerOptions,\n resolutionHost,\n typescript.resolveModuleName\n );\n};\n\nexports.resolveTypeReferenceDirective = (\n typescript,\n moduleName,\n containingFile,\n compilerOptions,\n resolutionHost\n) =\u003E {\n return resolveModuleName(\n moduleName,\n containingFile,\n compilerOptions,\n resolutionHost,\n typescript.resolveTypeReferenceDirective\n );\n};\n","directory_shortid":"BkTIAdXfr","id":"a1311497-29be-4a09-877a-ed8249c5c765","inserted_at":"2019-07-22T18:20:05","is_binary":false,"shortid":"Hyo68ROXGS","source_id":"f4383241-686b-4488-b946-849ecc3cadc3","title":"pnpTs.js","updated_at":"2019-07-22T18:20:05","upload_id":null},{"code":"'use strict';\n\nconst path = require('path');\nconst fs = require('fs');\nconst url = require('url');\n\n\u002F\u002F Make sure any symlinks in the project folder are resolved:\n\u002F\u002F https:\u002F\u002Fgithub.com\u002Ffacebook\u002Fcreate-react-app\u002Fissues\u002F637\nconst appDirectory = fs.realpathSync(process.cwd());\nconst resolveApp = relativePath =\u003E path.resolve(appDirectory, relativePath);\n\nconst envPublicUrl = process.env.PUBLIC_URL;\n\nfunction ensureSlash(inputPath, needsSlash) {\n const hasSlash = inputPath.endsWith('\u002F');\n if (hasSlash && !needsSlash) {\n return inputPath.substr(0, inputPath.length - 1);\n } else if (!hasSlash && needsSlash) {\n return `${inputPath}\u002F`;\n } else {\n return inputPath;\n }\n}\n\nconst getPublicUrl = appPackageJson =\u003E\n envPublicUrl || require(appPackageJson).homepage;\n\n\u002F\u002F We use `PUBLIC_URL` environment variable or \"homepage\" field to infer\n\u002F\u002F \"public path\" at which the app is served.\n\u002F\u002F Webpack needs to know it to put the right \u003Cscript\u003E hrefs into HTML even in\n\u002F\u002F single-page apps that may serve index.html for nested URLs like \u002Ftodos\u002F42.\n\u002F\u002F We can't use a relative path in HTML because we don't want to load something\n\u002F\u002F like \u002Ftodos\u002F42\u002Fstatic\u002Fjs\u002Fbundle.7289d.js. We have to know the root.\nfunction getServedPath(appPackageJson) {\n const publicUrl = getPublicUrl(appPackageJson);\n const servedUrl =\n envPublicUrl || (publicUrl ? url.parse(publicUrl).pathname : '\u002F');\n return ensureSlash(servedUrl, true);\n}\n\nconst moduleFileExtensions = [\n 'web.mjs',\n 'mjs',\n 'web.js',\n 'js',\n 'web.ts',\n 'ts',\n 'web.tsx',\n 'tsx',\n 'json',\n 'web.jsx',\n 'jsx',\n];\n\n\u002F\u002F Resolve file paths in the same order as webpack\nconst resolveModule = (resolveFn, filePath) =\u003E {\n const extension = moduleFileExtensions.find(extension =\u003E\n fs.existsSync(resolveFn(`${filePath}.${extension}`))\n );\n\n if (extension) {\n return resolveFn(`${filePath}.${extension}`);\n }\n\n return resolveFn(`${filePath}.js`);\n};\n\n\u002F\u002F config after eject: we're in .\u002Fconfig\u002F\nmodule.exports = {\n dotenv: resolveApp('.env'),\n appPath: resolveApp('.'),\n appBuild: resolveApp('build'),\n appPublic: resolveApp('public'),\n appHtml: resolveApp('public\u002Findex.html'),\n appIndexJs: resolveModule(resolveApp, 'src\u002Findex'),\n appPackageJson: resolveApp('package.json'),\n appSrc: resolveApp('src'),\n appTsConfig: resolveApp('tsconfig.json'),\n appJsConfig: resolveApp('jsconfig.json'),\n yarnLockFile: resolveApp('yarn.lock'),\n testsSetup: resolveModule(resolveApp, 'src\u002FsetupTests'),\n proxySetup: resolveApp('src\u002FsetupProxy.js'),\n appNodeModules: resolveApp('node_modules'),\n publicUrl: getPublicUrl(resolveApp('package.json')),\n servedPath: getServedPath(resolveApp('package.json')),\n};\n\n\n\nmodule.exports.moduleFileExtensions = moduleFileExtensions;\n","directory_shortid":"BkTIAdXfr","id":"f92eccca-d7aa-456b-9ebf-07aa3f51b0a4","inserted_at":"2019-07-22T18:20:05","is_binary":false,"shortid":"S1qTIROQzS","source_id":"f4383241-686b-4488-b946-849ecc3cadc3","title":"paths.js","updated_at":"2019-07-22T18:20:05","upload_id":null},{"code":"'use strict';\n\nconst fs = require('fs');\nconst path = require('path');\nconst paths = require('.\u002Fpaths');\nconst chalk = require('react-dev-utils\u002Fchalk');\n\n\u002F**\n * Get the baseUrl of a compilerOptions object.\n *\n * @param {Object} options\n *\u002F\nfunction getAdditionalModulePaths(options = {}) {\n const baseUrl = options.baseUrl;\n\n \u002F\u002F We need to explicitly check for null and undefined (and not a falsy value) because\n \u002F\u002F TypeScript treats an empty string as `.`.\n if (baseUrl == null) {\n \u002F\u002F If there's no baseUrl set we respect NODE_PATH\n \u002F\u002F Note that NODE_PATH is deprecated and will be removed\n \u002F\u002F in the next major release of create-react-app.\n\n const nodePath = process.env.NODE_PATH || '';\n return nodePath.split(path.delimiter).filter(Boolean);\n }\n\n const baseUrlResolved = path.resolve(paths.appPath, baseUrl);\n\n \u002F\u002F We don't need to do anything if `baseUrl` is set to `node_modules`. This is\n \u002F\u002F the default behavior.\n if (path.relative(paths.appNodeModules, baseUrlResolved) === '') {\n return null;\n }\n\n \u002F\u002F Allow the user set the `baseUrl` to `appSrc`.\n if (path.relative(paths.appSrc, baseUrlResolved) === '') {\n return [paths.appSrc];\n }\n\n \u002F\u002F Otherwise, throw an error.\n throw new Error(\n chalk.red.bold(\n \"Your project's `baseUrl` can only be set to `src` or `node_modules`.\" +\n ' Create React App does not support other values at this time.'\n )\n );\n}\n\nfunction getModules() {\n \u002F\u002F Check if TypeScript is setup\n const hasTsConfig = fs.existsSync(paths.appTsConfig);\n const hasJsConfig = fs.existsSync(paths.appJsConfig);\n\n if (hasTsConfig && hasJsConfig) {\n throw new Error(\n 'You have both a tsconfig.json and a jsconfig.json. If you are using TypeScript please remove your jsconfig.json file.'\n );\n }\n\n let config;\n\n \u002F\u002F If there's a tsconfig.json we assume it's a\n \u002F\u002F TypeScript project and set up the config\n \u002F\u002F based on tsconfig.json\n if (hasTsConfig) {\n config = require(paths.appTsConfig);\n \u002F\u002F Otherwise we'll check if there is jsconfig.json\n \u002F\u002F for non TS projects.\n } else if (hasJsConfig) {\n config = require(paths.appJsConfig);\n }\n\n config = config || {};\n const options = config.compilerOptions || {};\n\n const additionalModulePaths = getAdditionalModulePaths(options);\n\n return {\n additionalModulePaths: additionalModulePaths,\n hasTsConfig,\n };\n}\n\nmodule.exports = getModules();\n","directory_shortid":"BkTIAdXfr","id":"ab978099-afc8-4ec0-8680-9641e43068eb","inserted_at":"2019-07-22T18:20:05","is_binary":false,"shortid":"HJFaLRumGS","source_id":"f4383241-686b-4488-b946-849ecc3cadc3","title":"modules.js","updated_at":"2019-07-22T18:20:05","upload_id":null},{"code":"'use strict';\n\nconst path = require('path');\nconst camelcase = require('camelcase');\n\n\u002F\u002F This is a custom Jest transformer turning file imports into filenames.\n\u002F\u002F http:\u002F\u002Ffacebook.github.io\u002Fjest\u002Fdocs\u002Fen\u002Fwebpack.html\n\nmodule.exports = {\n process(src, filename) {\n const assetFilename = JSON.stringify(path.basename(filename));\n\n if (filename.match(\u002F\\.svg$\u002F)) {\n \u002F\u002F Based on how SVGR generates a component name:\n \u002F\u002F https:\u002F\u002Fgithub.com\u002Fsmooth-code\u002Fsvgr\u002Fblob\u002F01b194cf967347d43d4cbe6b434404731b87cf27\u002Fpackages\u002Fcore\u002Fsrc\u002Fstate.js#L6\n const pascalCaseFileName = camelcase(path.parse(filename).name, {\n pascalCase: true,\n });\n const componentName = `Svg${pascalCaseFileName}`;\n return `const React = require('react');\n module.exports = {\n __esModule: true,\n default: ${assetFilename},\n ReactComponent: React.forwardRef(function ${componentName}(props, ref) {\n return {\n $typeof: Symbol.for('react.element'),\n type: 'svg',\n ref: ref,\n key: null,\n props: Object.assign({}, props, {\n children: ${assetFilename}\n })\n };\n }),\n };`;\n }\n\n return `module.exports = ${assetFilename};`;\n },\n};\n","directory_shortid":"r1eaUROXMS","id":"8011438d-64f1-49ba-8691-67306e117f15","inserted_at":"2019-07-22T18:20:05","is_binary":false,"shortid":"rJupIAumMr","source_id":"f4383241-686b-4488-b946-849ecc3cadc3","title":"fileTransform.js","updated_at":"2019-07-22T18:20:05","upload_id":null},{"code":"'use strict';\n\n\u002F\u002F This is a custom Jest transformer turning style imports into empty objects.\n\u002F\u002F http:\u002F\u002Ffacebook.github.io\u002Fjest\u002Fdocs\u002Fen\u002Fwebpack.html\n\nmodule.exports = {\n process() {\n return 'module.exports = {};';\n },\n getCacheKey() {\n \u002F\u002F The output is always the same.\n return 'cssTransform';\n },\n};\n","directory_shortid":"r1eaUROXMS","id":"a3d90933-bfe0-4536-a6f1-bfe10a4c8094","inserted_at":"2019-07-22T18:20:05","is_binary":false,"shortid":"S1wTLRumMr","source_id":"f4383241-686b-4488-b946-849ecc3cadc3","title":"cssTransform.js","updated_at":"2019-07-22T18:20:05","upload_id":null},{"code":"'use strict';\n\nconst fs = require('fs');\nconst path = require('path');\nconst paths = require('.\u002Fpaths');\n\n\u002F\u002F Make sure that including paths.js after env.js will read .env variables.\ndelete require.cache[require.resolve('.\u002Fpaths')];\n\nconst NODE_ENV = process.env.NODE_ENV;\nif (!NODE_ENV) {\n throw new Error(\n 'The NODE_ENV environment variable is required but was not specified.'\n );\n}\n\n\u002F\u002F https:\u002F\u002Fgithub.com\u002Fbkeepers\u002Fdotenv#what-other-env-files-can-i-use\nvar dotenvFiles = [\n `${paths.dotenv}.${NODE_ENV}.local`,\n `${paths.dotenv}.${NODE_ENV}`,\n \u002F\u002F Don't include `.env.local` for `test` environment\n \u002F\u002F since normally you expect tests to produce the same\n \u002F\u002F results for everyone\n NODE_ENV !== 'test' && `${paths.dotenv}.local`,\n paths.dotenv,\n].filter(Boolean);\n\n\u002F\u002F Load environment variables from .env* files. Suppress warnings using silent\n\u002F\u002F if this file is missing. dotenv will never modify any environment variables\n\u002F\u002F that have already been set. Variable expansion is supported in .env files.\n\u002F\u002F https:\u002F\u002Fgithub.com\u002Fmotdotla\u002Fdotenv\n\u002F\u002F https:\u002F\u002Fgithub.com\u002Fmotdotla\u002Fdotenv-expand\ndotenvFiles.forEach(dotenvFile =\u003E {\n if (fs.existsSync(dotenvFile)) {\n require('dotenv-expand')(\n require('dotenv').config({\n path: dotenvFile,\n })\n );\n }\n});\n\n\u002F\u002F We support resolving modules according to `NODE_PATH`.\n\u002F\u002F This lets you use absolute paths in imports inside large monorepos:\n\u002F\u002F https:\u002F\u002Fgithub.com\u002Ffacebook\u002Fcreate-react-app\u002Fissues\u002F253.\n\u002F\u002F It works similar to `NODE_PATH` in Node itself:\n\u002F\u002F https:\u002F\u002Fnodejs.org\u002Fapi\u002Fmodules.html#modules_loading_from_the_global_folders\n\u002F\u002F Note that unlike in Node, only *relative* paths from `NODE_PATH` are honored.\n\u002F\u002F Otherwise, we risk importing Node.js core modules into an app instead of Webpack shims.\n\u002F\u002F https:\u002F\u002Fgithub.com\u002Ffacebook\u002Fcreate-react-app\u002Fissues\u002F1023#issuecomment-265344421\n\u002F\u002F We also resolve them to make sure all tools using them work consistently.\nconst appDirectory = fs.realpathSync(process.cwd());\nprocess.env.NODE_PATH = (process.env.NODE_PATH || '')\n .split(path.delimiter)\n .filter(folder =\u003E folder && !path.isAbsolute(folder))\n .map(folder =\u003E path.resolve(appDirectory, folder))\n .join(path.delimiter);\n\n\u002F\u002F Grab NODE_ENV and REACT_APP_* environment variables and prepare them to be\n\u002F\u002F injected into the application via DefinePlugin in Webpack configuration.\nconst REACT_APP = \u002F^REACT_APP_\u002Fi;\n\nfunction getClientEnvironment(publicUrl) {\n const raw = Object.keys(process.env)\n .filter(key =\u003E REACT_APP.test(key))\n .reduce(\n (env, key) =\u003E {\n env[key] = process.env[key];\n return env;\n },\n {\n \u002F\u002F Useful for determining whether we’re running in production mode.\n \u002F\u002F Most importantly, it switches React into the correct mode.\n NODE_ENV: process.env.NODE_ENV || 'development',\n \u002F\u002F Useful for resolving the correct path to static assets in `public`.\n \u002F\u002F For example, \u003Cimg src={process.env.PUBLIC_URL + '\u002Fimg\u002Flogo.png'} \u002F\u003E.\n \u002F\u002F This should only be used as an escape hatch. Normally you would put\n \u002F\u002F images into the `src` and `import` them in code to get their paths.\n PUBLIC_URL: publicUrl,\n }\n );\n \u002F\u002F Stringify all values so we can feed into Webpack DefinePlugin\n const stringified = {\n 'process.env': Object.keys(raw).reduce((env, key) =\u003E {\n env[key] = JSON.stringify(raw[key]);\n return env;\n }, {}),\n };\n\n return { raw, stringified };\n}\n\nmodule.exports = getClientEnvironment;\n","directory_shortid":"BkTIAdXfr","id":"dfaad801-dfd7-4c9e-a9e1-1cf8d2ebf5fe","inserted_at":"2019-07-22T18:20:05","is_binary":false,"shortid":"r1UT80OXzB","source_id":"f4383241-686b-4488-b946-849ecc3cadc3","title":"env.js","updated_at":"2019-07-22T18:20:05","upload_id":null},{"code":"This project was bootstrapped with [Create React App](https:\u002F\u002Fgithub.com\u002Ffacebook\u002Fcreate-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `npm start`\n\nRuns the app in the development mode.\u003Cbr\u003E\nOpen [http:\u002F\u002Flocalhost:3000](http:\u002F\u002Flocalhost:3000) to view it in the browser.\n\nThe page will reload if you make edits.\u003Cbr\u003E\nYou will also see any lint errors in the console.\n\n### `npm test`\n\nLaunches the test runner in the interactive watch mode.\u003Cbr\u003E\nSee the section about [running tests](https:\u002F\u002Ffacebook.github.io\u002Fcreate-react-app\u002Fdocs\u002Frunning-tests) for more information.\n\n### `npm run build`\n\nBuilds the app for production to the `build` folder.\u003Cbr\u003E\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\u003Cbr\u003E\nYour app is ready to be deployed!\n\nSee the section about [deployment](https:\u002F\u002Ffacebook.github.io\u002Fcreate-react-app\u002Fdocs\u002Fdeployment) for more information.\n\n### `npm run eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can’t go back!**\n\nIf you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (Webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.\n\nYou don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https:\u002F\u002Ffacebook.github.io\u002Fcreate-react-app\u002Fdocs\u002Fgetting-started).\n\nTo learn React, check out the [React documentation](https:\u002F\u002Freactjs.org\u002F).\n\n### Code Splitting\n\nThis section has moved here: https:\u002F\u002Ffacebook.github.io\u002Fcreate-react-app\u002Fdocs\u002Fcode-splitting\n\n### Analyzing the Bundle Size\n\nThis section has moved here: https:\u002F\u002Ffacebook.github.io\u002Fcreate-react-app\u002Fdocs\u002Fanalyzing-the-bundle-size\n\n### Making a Progressive Web App\n\nThis section has moved here: https:\u002F\u002Ffacebook.github.io\u002Fcreate-react-app\u002Fdocs\u002Fmaking-a-progressive-web-app\n\n### Advanced Configuration\n\nThis section has moved here: https:\u002F\u002Ffacebook.github.io\u002Fcreate-react-app\u002Fdocs\u002Fadvanced-configuration\n\n### Deployment\n\nThis section has moved here: https:\u002F\u002Ffacebook.github.io\u002Fcreate-react-app\u002Fdocs\u002Fdeployment\n\n### `npm run build` fails to minify\n\nThis section has moved here: https:\u002F\u002Ffacebook.github.io\u002Fcreate-react-app\u002Fdocs\u002Ftroubleshooting#npm-run-build-fails-to-minify\n","directory_shortid":null,"id":"619e99e6-0a11-4714-a4b0-1248fd44e0e8","inserted_at":"2019-07-22T18:20:05","is_binary":false,"shortid":"ryHpUAumMB","source_id":"f4383241-686b-4488-b946-849ecc3cadc3","title":"README.md","updated_at":"2019-07-22T18:20:05","upload_id":null},{"code":"# See https:\u002F\u002Fhelp.github.com\u002Farticles\u002Fignoring-files\u002F for more about ignoring files.\n\n# dependencies\n\u002Fnode_modules\n\u002F.pnp\n.pnp.js\n\n# testing\n\u002Fcoverage\n\n# production\n\u002Fbuild\n\n# misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n","directory_shortid":null,"id":"27a49afa-25cd-4ec5-be40-5e9b3e14f684","inserted_at":"2019-07-22T18:20:05","is_binary":false,"shortid":"SJVTU0OmzS","source_id":"f4383241-686b-4488-b946-849ecc3cadc3","title":".gitignore","updated_at":"2019-07-22T18:20:05","upload_id":null}],"updated_at":"2020-01-29T15:54:52","view_count":2683,"screenshot_url":"https:\u002F\u002Fcodesandbox.io\u002Fstatic\u002Fimg\u002Fbanner.png","template":"node","alias":"demo-react-rdserver-client-ntjs3","original_git_commit_sha":null,"description":null,"picks":[],"git":{"branch":"master","commit_sha":"9e7f9ddb9752d88f3829f98f45960502c4f9f4f9","path":"","repo":"demo-react-rdserver-client","username":"oliversturm"},"privacy":0,"owned":false,"author":null,"version":3,"original_git":null,"tags":[]};