diff --git a/packages/eslint-config-react-app/index.js b/packages/eslint-config-react-app/index.js index 6df5bfdd93b..a067dd091b3 100644 --- a/packages/eslint-config-react-app/index.js +++ b/packages/eslint-config-react-app/index.js @@ -43,8 +43,7 @@ module.exports = { settings: { 'import/ignore': [ - 'node_modules', - '\\.(json|css|ico|jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$', + 'node_modules' ], 'import/extensions': ['.js'], 'import/resolver': { diff --git a/packages/react-scripts/config/webpack.config.dev.js b/packages/react-scripts/config/webpack.config.dev.js index 9587d5894d1..8e264d40286 100644 --- a/packages/react-scripts/config/webpack.config.dev.js +++ b/packages/react-scripts/config/webpack.config.dev.js @@ -124,7 +124,7 @@ module.exports = { // A missing `test` is equivalent to a match. { exclude: [ - /\.(html)$/, + /\.html$/, /\.(js|jsx)$/, /\.css$/, /\.json$/ diff --git a/packages/react-scripts/config/webpack.config.prod.js b/packages/react-scripts/config/webpack.config.prod.js index b4abc0c2e1d..60016896892 100644 --- a/packages/react-scripts/config/webpack.config.prod.js +++ b/packages/react-scripts/config/webpack.config.prod.js @@ -124,15 +124,13 @@ module.exports = { // we need to add the supported extension to this loader too. // Add one new line in `exclude` for each loader. // - // "file" loader makes sure those assets get served by WebpackDevServer. - // When you `import` an asset, you get its (virtual) filename. - // In production, they would get copied to the `build` folder. - // "url" loader works like "file" loader except that it embeds assets - // smaller than specified limit in bytes as data URLs to avoid requests. - // A missing `test` is equivalent to a match. + // "file" loader makes sure those assets end up in the `build` folder. + // When you `import` an asset, you get its filename. + // "url" loader works just like "file" loader but it also embeds + // assets smaller than specified size as data URLs to avoid requests. { exclude: [ - /\.(html)$/, + /\.html$/, /\.(js|jsx)$/, /\.css$/, /\.json$/ diff --git a/packages/react-scripts/utils/createJestConfig.js b/packages/react-scripts/utils/createJestConfig.js index 38bef100623..46f3a1da1a5 100644 --- a/packages/react-scripts/utils/createJestConfig.js +++ b/packages/react-scripts/utils/createJestConfig.js @@ -20,7 +20,7 @@ module.exports = (resolve, rootDir, isEjecting) => { const config = { collectCoverageFrom: ['src/**/*.{js,jsx}'], moduleNameMapper: { - '^.+\\.(ico|jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$': resolve('config/jest/FileStub.js'), + '^.+\\.(?!(js|jsx|css|json)$)[^\\.]+$': resolve('config/jest/FileStub.js'), '^.+\\.css$': resolve('config/jest/CSSStub.js') }, setupFiles: [resolve('config/polyfills.js')],