Skip to content

Commit

Permalink
fix: keep the package commonjs backwards compatible via Babel
Browse files Browse the repository at this point in the history
  • Loading branch information
aminya committed Oct 3, 2023
1 parent 322184f commit db12257
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ yarn.lock
/lib/modules/*.js
/lib/presets/*.js
/test.js
/index.js

# Docs
/docs/build/
Expand Down
12 changes: 10 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,21 @@
"name": "htmlnano",
"version": "2.0.4",
"description": "Modular HTML minifier, built on top of the PostHTML",
"main": "index.mjs",
"main": "index.js",
"module": "index.mjs",
"source": "index.mjs",
"exports": {
".": {
"require": "./index.js",
"import": "./index.mjs"
}
},
"types": "index.d.ts",
"author": "Kirill Maltsev <maltsevkirill@gmail.com>",
"license": "MIT",
"scripts": {
"clean": "rimraf lib/*.js lib/**/*.js",
"compile": "npm run clean && babel -d lib/ lib/",
"compile": "npm run clean && babel -d lib/ lib/ && babel -d ./ ./*.mjs",
"lint": "eslint --fix *.mjs lib/*.mjs lib/**/*.mjs test/*.mjs test/**/*.mjs",
"pretest": "npm run lint && npm run compile",
"test": ":",
Expand Down

0 comments on commit db12257

Please sign in to comment.