Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add types and gitignore #64

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
package-lock.json
2 changes: 1 addition & 1 deletion dist/dropcss.cjs.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (c) 2021, Leon Sorokin
* Copyright (c) 2023, Leon Sorokin
* All rights reserved. (MIT Licensed)
*
* dropcss.js (DropCSS)
Expand Down
4 changes: 2 additions & 2 deletions dist/dropcss.iife.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (c) 2021, Leon Sorokin
* Copyright (c) 2023, Leon Sorokin
* All rights reserved. (MIT Licensed)
*
* dropcss.js (DropCSS)
Expand Down Expand Up @@ -1091,4 +1091,4 @@ var dropcss = (function () {

return dropcss;

}());
})();
2 changes: 1 addition & 1 deletion dist/dropcss.iife.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "1.0.16",
"description": "An exceptionally fast, thorough and tiny unused-CSS cleaner",
"main": "./dist/dropcss.cjs.js",
"types": "./src/types.d.ts",
ghostdevv marked this conversation as resolved.
Show resolved Hide resolved
"scripts": {
"build": "rollup -c",
"test": "nyc mocha test/src/*.js",
Expand All @@ -11,6 +12,7 @@
"author": "Leon Sorokin <leeoniya@gmail.com>",
"license": "MIT",
"files": [
"./src/types.d.ts",
"package.json",
"README.md",
"LICENSE",
Expand Down
9 changes: 9 additions & 0 deletions src/types.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
export interface DropcssOptions {
html: string;
css: string;

shouldDrop?: (selector: string) => boolean;
didRetain?: (selector: string) => void;
}

export default function dropcss(options: DropcssOptions): { css: string };