diff --git a/packages/react-scripts/config/webpack.config.js b/packages/react-scripts/config/webpack.config.js index 6eea958af15..bfef19106f9 100644 --- a/packages/react-scripts/config/webpack.config.js +++ b/packages/react-scripts/config/webpack.config.js @@ -414,6 +414,19 @@ module.exports = function (webpackEnv) { test: /\.(js|mjs|jsx|ts|tsx)$/, include: paths.appSrc, loader: require.resolve('babel-loader'), + // Allow "type": "module" in package.json without + // fully-specified file extension + // https://webpack.js.org/configuration/module/#resolvefullyspecified + // + // We require "type": "module" in package.json because + // ESLint we want to use ESM syntax in our eslint.config.js + // file and ESLint does not support other ways of specifying + // that the config file is ESM such as an .mjs extension: + // https://github.com/eslint/eslint/issues/13440 + // https://github.com/eslint/eslint/issues/16580 + resolve: { + fullySpecified: false, + }, options: { customize: require.resolve( 'babel-preset-react-app/webpack-overrides', diff --git a/packages/react-scripts/package.json b/packages/react-scripts/package.json index 8696cc7f6de..5b7bd2c174f 100644 --- a/packages/react-scripts/package.json +++ b/packages/react-scripts/package.json @@ -1,6 +1,6 @@ { "name": "@upleveled/react-scripts", - "version": "5.0.11", + "version": "5.0.13", "description": "Configuration and scripts for Create React App.", "bugs": { "url": "https://github.com/facebook/create-react-app/issues"