Skip to content

Commit e9f77d2

Browse files
committed
✨ output a mnml.min.js file as well
1 parent bbc6b4c commit e9f77d2

File tree

3 files changed

+30
-3
lines changed

3 files changed

+30
-3
lines changed

package-lock.json

Lines changed: 20 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,17 @@
99
"test": "echo \"Error: no test specified\" && exit 0",
1010
"clean": "rimraf dist",
1111
"prebuild": "npm run clean",
12-
"build": "tsc --project tsconfig.json",
12+
"build": "tsc --project tsconfig.json && uglifyjs dist/mnml.js -o dist/mnml.min.js --compress --comments --source-map \"url=mnml.min.js.map,includeSources\"",
13+
"postbuild": "MNML_VERSION=$(node -pe \"require('./package.json').version\") && cat dist/mnml.js | sed -E \"s/@version$/@version $MNML_VERSION/g\" | tee dist/mnml.js > /dev/null",
1314
"watch": "npm run build -- --watch",
1415
"prepublish": "npm run build"
1516
},
1617
"author": "dryan <[email protected]>",
1718
"license": "MPL",
1819
"devDependencies": {
1920
"rimraf": "^3.0.2",
20-
"typescript": "^4.5.5"
21+
"typescript": "^4.5.5",
22+
"uglify-js": "^3.17.4"
2123
},
2224
"files": [
2325
"dist/**/*"

src/mnml.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
/*
2+
* 🛠️ mnml.js
3+
* @version
4+
* @license MPL-2.0
5+
*/
6+
17
export type MnmlEventCallback = (ev?: Event, match?: HTMLElement) => void;
28
export type MnmlEventCallbackGuaranteedParams = (ev: Event, match: HTMLElement) => void;
39

0 commit comments

Comments
 (0)