From 9e4a22ec73cdde89713e3b046275f4484f62b100 Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Sat, 12 Oct 2024 04:52:06 +0100 Subject: [PATCH] fix(devtools): remove cjs entrypoint (#746) --- packages/devtools/module.cjs | 15 --------------- packages/devtools/package.json | 6 ++---- 2 files changed, 2 insertions(+), 19 deletions(-) delete mode 100644 packages/devtools/module.cjs diff --git a/packages/devtools/module.cjs b/packages/devtools/module.cjs deleted file mode 100644 index e3ecaed26..000000000 --- a/packages/devtools/module.cjs +++ /dev/null @@ -1,15 +0,0 @@ -/* eslint-disable eslint-comments/no-unlimited-disable */ -/* eslint-disable */ -module.exports = function (...args) { - const nuxt = this.nuxt || args[1] - let _a - let version = (nuxt == null ? void 0 : nuxt._version) || (nuxt == null ? void 0 : nuxt.version) || ((_a = nuxt == null ? void 0 : nuxt.constructor) == null ? void 0 : _a.version) || '' - version = version.replace(/^v/g, '') - // Nuxt DevTools is not compatible with Nuxt 2, disabled - if (version.startsWith('2.')) { - return - } - return import('./dist/module.mjs').then(m => m.default.call(this, ...args)) -} -const _meta = module.exports.meta = require('./dist/module.json') -module.exports.getMeta = () => Promise.resolve(_meta) diff --git a/packages/devtools/package.json b/packages/devtools/package.json index 163f5a0bd..23a4e36a4 100644 --- a/packages/devtools/package.json +++ b/packages/devtools/package.json @@ -13,16 +13,14 @@ "exports": { ".": { "types": "./dist/module.d.mts", - "import": "./dist/module.mjs", - "require": "./module.cjs" + "import": "./dist/module.mjs" }, "./types": { "types": "./dist/types.d.ts" }, "./*": "./*" }, - "main": "./module.cjs", - "types": "./dist/module.d.ts", + "types": "./dist/module.d.mts", "bin": "./cli.mjs", "files": [ "*.cjs",