Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow "type": "module" in package.json w/out ext #3

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions packages/react-scripts/config/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
2 changes: 1 addition & 1 deletion packages/react-scripts/package.json
Original file line number Diff line number Diff line change
@@ -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"
Expand Down