From 94a21bc75e9906e74cf125614f45a5d767f126bc Mon Sep 17 00:00:00 2001 From: Franck Royer Date: Tue, 26 Jul 2022 15:18:03 +1000 Subject: [PATCH] feat! remove esm package folder --- build-scripts/fix-imports.js | 2 +- package.json | 12 ++++++------ tsconfig.json | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/build-scripts/fix-imports.js b/build-scripts/fix-imports.js index e7886a921c..31562e9046 100644 --- a/build-scripts/fix-imports.js +++ b/build-scripts/fix-imports.js @@ -1,7 +1,7 @@ import path from "path"; import fs from "fs"; -const START_PATH = path.join(process.cwd(), "dist/esm"); +const START_PATH = path.join(process.cwd(), "dist/"); const IMPORT_REGEXP = /^((import|export) [^';]* from "(\.[^@";]*\/[^";]*)[^";]*)"/g; const JUST_ADD_AN_EXTENSION = '$1.js"'; diff --git a/package.json b/package.json index c2c474a8d0..f6632bcbf1 100644 --- a/package.json +++ b/package.json @@ -2,12 +2,12 @@ "name": "js-waku", "version": "0.24.0", "description": "TypeScript implementation of the Waku v2 protocol", - "types": "./dist/esm/index.d.ts", - "module": "./dist/esm/index.js", + "types": "./dist/index.d.ts", + "module": "./dist/index.js", "exports": { ".": { - "types": "./dist/esm/index.d.ts", - "import": "./dist/esm/index.js" + "types": "./dist/index.d.ts", + "import": "./dist/index.js" } }, "type": "module", @@ -25,7 +25,7 @@ "prepare": "husky install", "build": "rimraf ./dist; run-s build:**", "build:esm": "tsc && node build-scripts/fix-imports.js", - "build:bundle": "rollup --config rollup.config.js -- dist/esm/index.js", + "build:bundle": "rollup --config rollup.config.js -- dist/index.js", "build:bundle:min": "terser --ecma 11 --compress --mangle -o dist/bundle.min.js -- dist/bundle.js && gzip -9 -c dist/bundle.min.js > dist/bundle.min.js.gz", "size": "npm run build && size-limit", "fix": "run-s fix:*", @@ -152,7 +152,7 @@ "webpack-cli": "^4.10.0" }, "files": [ - "dist/esm", + "dist", "src/*.ts", "src/lib/**/*.ts", "src/proto/**/*.ts", diff --git a/tsconfig.json b/tsconfig.json index f0913da833..b958d4581f 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -2,7 +2,7 @@ "compilerOptions": { "incremental": true, "target": "es2020", - "outDir": "dist/esm", + "outDir": "dist/", "rootDir": "src", "moduleResolution": "node", "module": "es2020",