diff --git a/package.json b/package.json index 593e8aeb..4fe29061 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,8 @@ "lib", "conf", "LICENSE", - "dist" + "dist", + "universal.js" ], "publishConfig": { "access": "public" diff --git a/universal.js b/universal.js new file mode 100644 index 00000000..4e1846ee --- /dev/null +++ b/universal.js @@ -0,0 +1,9 @@ +// Jest (and probably some other runtimes with custom implementations of +// `require`) doesn't support `exports` in `package.json`, so this file is here +// to help them load this module. Note that it is also `.js` and not `.cjs` for +// the same reason - `cjs` files requires to be loaded with an extension, but +// since Jest doesn't respect `module` outside of ESM mode it still works in +// this case (and the `require` in _this_ file does specify the extension). + +// eslint-disable-next-line no-undef +module.exports = require("./dist/eslintrc-universal.cjs");