From 7014aedddab2db2f985aa90192445cf8530adc0f Mon Sep 17 00:00:00 2001 From: William Monk Date: Tue, 11 Jul 2017 19:16:38 +0100 Subject: [PATCH] Fix Code Review --- .github/ISSUE_TEMPLATE.md | 4 ++++ packages/react-scripts/config/webpack.config.dev.js | 12 +++++++++++- packages/react-scripts/config/webpack.config.prod.js | 12 +++++++++++- packages/react-scripts/package.json | 6 +++--- .../react-scripts/scripts/utils/createJestConfig.js | 12 +++++++++++- packages/react-scripts/template/src/index.js | 8 -------- 6 files changed, 40 insertions(+), 14 deletions(-) delete mode 100644 packages/react-scripts/template/src/index.js diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index ba161361..405acc96 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -83,7 +83,11 @@ 2. `node -v`: 3. `npm -v`: 4. `yarn --version` (if you use Yarn): +<<<<<<< HEAD 5. `npm ls react-scripts` (if you haven’t ejected): +======= +3. `npm ls react-scripts-ts` (if you haven’t ejected): +>>>>>>> Fix Code Review Then, specify: diff --git a/packages/react-scripts/config/webpack.config.dev.js b/packages/react-scripts/config/webpack.config.dev.js index 128527dc..2934aeae 100644 --- a/packages/react-scripts/config/webpack.config.dev.js +++ b/packages/react-scripts/config/webpack.config.dev.js @@ -95,7 +95,17 @@ module.exports = { // https://github.com/facebookincubator/create-react-app/issues/290 // `web` extension prefixes have been added for better support // for React Native Web. - extensions: ['.web.ts', '.ts', '.tsx', '.web.tsx', '.web.js', '.js', '.json', '.web.jsx', '.jsx'], + extensions: [ + '.web.ts', + '.ts', + '.web.tsx', + '.tsx', + '.web.js', + '.js', + '.json', + '.web.jsx', + '.jsx', + ], alias: { // @remove-on-eject-begin // Resolve Babel runtime relative to react-scripts. diff --git a/packages/react-scripts/config/webpack.config.prod.js b/packages/react-scripts/config/webpack.config.prod.js index 61ccc77d..8519c660 100644 --- a/packages/react-scripts/config/webpack.config.prod.js +++ b/packages/react-scripts/config/webpack.config.prod.js @@ -95,7 +95,17 @@ module.exports = { // https://github.com/facebookincubator/create-react-app/issues/290 // `web` extension prefixes have been added for better support // for React Native Web. - extensions: ['.web.ts', '.ts', '.tsx', '.web.tsx', '.web.js', '.js', '.json', '.web.jsx', '.jsx'], + extensions: [ + '.web.ts', + '.ts', + '.web.tsx', + '.tsx', + '.web.js', + '.js', + '.json', + '.web.jsx', + '.jsx', + ], alias: { // @remove-on-eject-begin // Resolve Babel runtime relative to react-scripts. diff --git a/packages/react-scripts/package.json b/packages/react-scripts/package.json index b541163c..94b18974 100644 --- a/packages/react-scripts/package.json +++ b/packages/react-scripts/package.json @@ -22,13 +22,13 @@ "react-scripts-ts": "./bin/react-scripts-ts.js" }, "dependencies": { - "autoprefixer": "7.1.0", "autoprefixer": "7.1.1", "app-root-path": "^2.0.1", "case-sensitive-paths-webpack-plugin": "2.1.1", "chalk": "1.1.3", + "chalk": "1.1.3", "cli-highlight": "1.1.4", - "css-loader": "0.28.1", + "css-loader": "0.28.4", "dotenv": "4.0.0", "extract-text-webpack-plugin": "2.1.2", "file-loader": "0.11.2", @@ -52,7 +52,7 @@ "sw-precache-webpack-plugin": "0.11.3", "url-loader": "0.5.8", "webpack": "2.6.1", - "webpack-dev-server": "2.4.5", + "webpack-dev-server": "2.5.0", "webpack-manifest-plugin": "1.1.0", "whatwg-fetch": "2.0.3" }, diff --git a/packages/react-scripts/scripts/utils/createJestConfig.js b/packages/react-scripts/scripts/utils/createJestConfig.js index 463d1e58..559f96f4 100644 --- a/packages/react-scripts/scripts/utils/createJestConfig.js +++ b/packages/react-scripts/scripts/utils/createJestConfig.js @@ -27,7 +27,17 @@ module.exports = (resolve, rootDir) => { collectCoverageFrom: ['src/**/*.{js,jsx,ts,tsx}'], setupFiles: [resolve('config/polyfills.js')], setupTestFrameworkScriptFile: setupTestsFile, - moduleFileExtensions: ['web.ts', 'ts', 'web.tsx', 'tsx', 'js', 'jsx', 'json'], + moduleFileExtensions: [ + 'web.ts', + 'ts', + 'web.tsx', + 'tsx', + 'web.js', + 'js', + 'web.jsx', + 'jsx', + 'json', + ], testMatch: [ '/src/**/__tests__/**/*.ts?(x)', '/src/**/?(*.)(spec|test).ts?(x)', diff --git a/packages/react-scripts/template/src/index.js b/packages/react-scripts/template/src/index.js deleted file mode 100644 index fae3e350..00000000 --- a/packages/react-scripts/template/src/index.js +++ /dev/null @@ -1,8 +0,0 @@ -import React from 'react'; -import ReactDOM from 'react-dom'; -import './index.css'; -import App from './App'; -import registerServiceWorker from './registerServiceWorker'; - -ReactDOM.render(, document.getElementById('root')); -registerServiceWorker();