From 3aabd0ca51567240b2dced82191765c5f968aa93 Mon Sep 17 00:00:00 2001 From: Daishi Kato Date: Mon, 13 Nov 2023 21:20:55 +0900 Subject: [PATCH] [v2] breaking: drop "module" condition (#818) --- package.json | 10 +--------- rollup.config.js | 1 - 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/package.json b/package.json index 291ed859..58f1a92c 100644 --- a/package.json +++ b/package.json @@ -33,10 +33,6 @@ "types": "./esm/index.d.mts", "default": "./esm/index.mjs" }, - "module": { - "types": "./esm/index.d.ts", - "default": "./esm/index.js" - }, "default": { "types": "./index.d.ts", "default": "./index.js" @@ -47,10 +43,6 @@ "types": "./esm/*.d.mts", "default": "./esm/*.mjs" }, - "module": { - "types": "./esm/*.d.ts", - "default": "./esm/*.js" - }, "default": { "types": "./*.d.ts", "default": "./*.js" @@ -85,7 +77,7 @@ "copy": "shx cp -r dist/src/* dist/esm && shx cp -r dist/src/* dist && shx rm -rf dist/{src,tests} && shx cp package.json readme.md LICENSE dist && json -I -f dist/package.json -e \"this.private=false; this.devDependencies=undefined; this.optionalDependencies=undefined; this.scripts=undefined; this.prettier=undefined;\"", "patch-macro-vite": "shx cp dist/esm/macro/vite.d.ts dist/macro/", "patch-old-ts": "shx touch dist/ts_version_4.5_and_above_is_required.d.ts", - "patch-esm-ts": "node -e \"require('shelljs').find('dist/esm/**/*.d.ts').forEach(f=>{var f2=f.replace(/\\.ts$/,'.mts');require('fs').copyFileSync(f,f2);require('shelljs').sed('-i',/ from '(\\.[^']+)';$/,' from \\'\\$1.mjs\\';',f2);require('shelljs').sed('-i',/^declare module '(\\.[^']+)'/,'declare module \\'\\$1.mjs\\'',f2)})\"" + "patch-esm-ts": "node -e \"require('shelljs').find('dist/esm/**/*.d.ts').forEach(f=>{var f2=f.replace(/\\.ts$/,'.mts');require('fs').renameSync(f,f2);require('shelljs').sed('-i',/ from '(\\.[^']+)';$/,' from \\'\\$1.mjs\\';',f2);require('shelljs').sed('-i',/^declare module '(\\.[^']+)'/,'declare module \\'\\$1.mjs\\'',f2)})\"" }, "engines": { "node": ">=12.20.0" diff --git a/rollup.config.js b/rollup.config.js index d6837b82..12e5e5c5 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -168,7 +168,6 @@ module.exports = function (args) { return [ ...(c === 'index' ? [createDeclarationConfig(`src/${c}.ts`, 'dist')] : []), createCommonJSConfig(`src/${c}.ts`, `dist/${c}`), - createESMConfig(`src/${c}.ts`, `dist/esm/${c}.js`), createESMConfig(`src/${c}.ts`, `dist/esm/${c}.mjs`), createUMDConfig(`src/${c}.ts`, `dist/umd/${c}`, 'development'), createUMDConfig(`src/${c}.ts`, `dist/umd/${c}`, 'production'),