diff --git a/package.json b/package.json index 613b489..50a7111 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "description": "The legacy ESLintRC config file format for ESLint", "type": "module", "main": "./dist/eslintrc.cjs", - "types": "./dist/eslintrc.d.ts", + "types": "./dist/eslintrc.d.cts", "exports": { ".": { "import": "./lib/index.js", diff --git a/rollup.config.js b/rollup.config.js index c8f1a33..6e151ef 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -1,3 +1,21 @@ +/** List of modules not included in the bundle. */ +const external = [ + "node:assert", + "node:fs", + "node:module", + "node:os", + "node:path", + "node:url", + "node:util", + "ajv", + "debug", + "globals", + "ignore", + "import-fresh", + "minimatch", + "strip-json-comments" +]; + /** * Custom Rollup plugin for `import.meta.url` transformation to commonjs. * The default transformation ('file:' + __filename) does not check characters in __filename, @@ -20,11 +38,7 @@ function importMetaURLPlugin() { export default [ { input: "./lib/index.js", - external: [ - "module", "util", "os", "path", "debug", "fs", "import-fresh", - "strip-json-comments", "assert", "ignore", "minimatch", "url", "ajv", - "globals" - ], + external, treeshake: false, output: { format: "cjs", @@ -36,11 +50,7 @@ export default [ }, { input: "./lib/index-universal.js", - external: [ - "module", "util", "os", "path", "debug", "fs", "import-fresh", - "strip-json-comments", "assert", "ignore", "minimatch", "url", "ajv", - "globals" - ], + external, treeshake: false, output: { format: "cjs",