feat: use types for css modules
This commit is contained in:
parent
8663e0d3bb
commit
afc6922bc7
@ -16,7 +16,7 @@ npm i -D esbuild-plugin-postcss2
|
|||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
Add to the plugin to your esbuild plugins:
|
Add the plugin to your esbuild plugins:
|
||||||
|
|
||||||
```js
|
```js
|
||||||
const esbuild = require("esbuild");
|
const esbuild = require("esbuild");
|
||||||
|
|||||||
5
build.js
5
build.js
@ -13,9 +13,4 @@ const production = process.env.NODE_ENV === "production",
|
|||||||
outfile: `./dist/index${format === "cjs" ? "" : "." + format}.js`
|
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");
|
|
||||||
});
|
|
||||||
})();
|
})();
|
||||||
|
|||||||
@ -10,7 +10,7 @@
|
|||||||
"access": "public"
|
"access": "public"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "NODE_ENV=production node build.js && tsc --emitDeclarationOnly",
|
"build": "NODE_ENV=production node build.js",
|
||||||
"dev": "NODE_ENV=development node build.js",
|
"dev": "NODE_ENV=development node build.js",
|
||||||
"test": "yarn build && cd test && mocha 'index.js' --no-timeout --exit",
|
"test": "yarn build && cd test && mocha 'index.js' --no-timeout --exit",
|
||||||
"fmt": "prettier --write .",
|
"fmt": "prettier --write .",
|
||||||
@ -20,11 +20,12 @@
|
|||||||
"pre-commit": "prettier --write . && git add -A"
|
"pre-commit": "prettier --write . && git add -A"
|
||||||
},
|
},
|
||||||
"files": [
|
"files": [
|
||||||
"dist"
|
"dist",
|
||||||
|
"src/modules.d.ts"
|
||||||
],
|
],
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"module": "dist/index.esm.js",
|
"module": "dist/index.esm.js",
|
||||||
"types": "dist/index.d.ts",
|
"types": "src/modules.d.ts",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"autoprefixer": "^10.2.4",
|
"autoprefixer": "^10.2.4",
|
||||||
"fs-extra": "^9.1.0",
|
"fs-extra": "^9.1.0",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user