From afc6922bc7b50a09ab16db0d861bb43b6f67deec Mon Sep 17 00:00:00 2001 From: Marton Lederer Date: Sun, 21 Feb 2021 10:11:46 +0100 Subject: [PATCH] feat: use types for css modules --- README.md | 2 +- build.js | 5 ----- package.json | 7 ++++--- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index abb67f4..7149b01 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ npm i -D esbuild-plugin-postcss2 ## Usage -Add to the plugin to your esbuild plugins: +Add the plugin to your esbuild plugins: ```js const esbuild = require("esbuild"); diff --git a/build.js b/build.js index 1aca7ec..d8f41d6 100644 --- a/build.js +++ b/build.js @@ -13,9 +13,4 @@ const production = process.env.NODE_ENV === "production", outfile: `./dist/index${format === "cjs" ? "" : "." + format}.js` }); } - - copyFile("./src/modules.d.ts", "./dist/modules.d.ts", (err) => { - if (err) throw err; - console.log("[modules.d.ts] copied"); - }); })(); diff --git a/package.json b/package.json index 15005c0..769fca7 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "access": "public" }, "scripts": { - "build": "NODE_ENV=production node build.js && tsc --emitDeclarationOnly", + "build": "NODE_ENV=production node build.js", "dev": "NODE_ENV=development node build.js", "test": "yarn build && cd test && mocha 'index.js' --no-timeout --exit", "fmt": "prettier --write .", @@ -20,11 +20,12 @@ "pre-commit": "prettier --write . && git add -A" }, "files": [ - "dist" + "dist", + "src/modules.d.ts" ], "main": "dist/index.js", "module": "dist/index.esm.js", - "types": "dist/index.d.ts", + "types": "src/modules.d.ts", "dependencies": { "autoprefixer": "^10.2.4", "fs-extra": "^9.1.0",