diff --git a/package.json b/package.json index d8eebe4..b1f103f 100644 --- a/package.json +++ b/package.json @@ -1,13 +1,12 @@ { "name": "show-key-press", - "version": "1.0.3", + "version": "1.0.4", "description": "A lightweight key press display tool that shows user keyboard inputs on screen in real-time. Perfect keyboard mapping support for both Mac and Windows systems.", "main": "./es/index.js", "files": [ "es" ], "scripts": { - "postinstall": "node node_modules/esbuild/install.js", "dev": "pnpm run build && cross-env NODE_ENV=developemnt rollup -m -c rollup.config.js -w", "start": "pnpm run dev", "build": "rm -fr dist && cross-env NODE_ENV=production rollup -c rollup.config.js " @@ -37,12 +36,12 @@ "@rollup/plugin-eslint": "^8.0.1", "@rollup/plugin-node-resolve": "^11.2.1", "@rollup/plugin-terser": "^0.4.4", + "@rollup/plugin-typescript": "^12.1.2", "@types/node": "^22.10.8", "@typescript-eslint/eslint-plugin": "^4.15.1", "@typescript-eslint/parser": "^4.15.1", "autoprefixer": "^10.4.20", "cross-env": "^7.0.3", - "esbuild": "^0.11.0", "eslint": "7.20.0", "eslint-config-airbnb": "18.2.1", "eslint-config-alloy": "4.2.0", @@ -50,7 +49,6 @@ "postcss": "^8.5.1", "prettier": "^2.3.2", "rollup": "^2.43.1", - "rollup-plugin-esbuild": "^3.0.2", "typescript": "^4.2.3" } } diff --git a/rollup.config.js b/rollup.config.js index 6f870be..b6e3212 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -1,8 +1,7 @@ -import esbuild from "rollup-plugin-esbuild"; import terser from "@rollup/plugin-terser"; +import typescript from '@rollup/plugin-typescript'; const ES_OUTPUT_DIR = "es"; -const isProd = process.env.NODE_ENV === "production"; export default { input: "src/index.ts", @@ -15,16 +14,9 @@ export default { }, ], plugins: [ - esbuild({ - include: /\.[jt]s?$/, // default, inferred from `loaders` option - exclude: /node_modules/, // default - minify: isProd, - target: "es2015", // default, or 'es20XX', 'esnext' - define: { - __VERSION__: '"x.y.z"', - }, - tsconfig: "tsconfig.json", // default + typescript({ + tsconfig: "tsconfig.json", }), terser(), ], -}; +}; \ No newline at end of file diff --git a/src/index.ts b/src/index.ts index 8e438e2..8b63bc7 100644 --- a/src/index.ts +++ b/src/index.ts @@ -146,7 +146,6 @@ class ShowKeyPress { if (!this.container) { this.container = document.createElement("div"); this.container.setAttribute("data-keys", ""); - console.log(this.options.el) const parent = this.options.el || document.body; parent.appendChild(this.container); } diff --git a/tsconfig.json b/tsconfig.json index 78b5210..f08f301 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,7 +1,7 @@ { "compilerOptions": { "baseUrl": ".", - "outDir": "./dist", + "outDir": "./es", "sourceMap": false, "target": "esnext", "module": "esnext", @@ -16,7 +16,6 @@ "jsx": "react", "declaration": true, "declarationMap": false, - "declarationDir": "./dist/types", "skipLibCheck": true, "lib": ["esnext", "dom"], "types": ["node"],