feat: use types for css modules

This commit is contained in:
Marton Lederer 2021-02-21 10:11:46 +01:00
parent 8663e0d3bb
commit afc6922bc7
No known key found for this signature in database
GPG Key ID: 9B7FD44832ADFE95
3 changed files with 5 additions and 9 deletions

View File

@ -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");

View File

@ -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");
});
})();

View File

@ -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",