Skip to content

Commit a984761

Browse files
Add minified script variant for NPM
1 parent 3fe44c8 commit a984761

File tree

4 files changed

+21
-7
lines changed

4 files changed

+21
-7
lines changed

.eslintrc.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
"use strict";
22

33
module.exports = {
4-
ignorePatterns: "!.*",
4+
ignorePatterns: [
5+
"!.*",
6+
"*.min.js"
7+
],
58

69
extends: "eslint:all",
710

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
/node_modules/
22
/package-lock.json
33
/yarn.lock
4+
/*.min.js

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ TCStringParse(consentString);
2020
### Browser (IE 9+ with atob polyfill)
2121

2222
```html
23-
<script src="path/to/tc-string-parse.js"></script>
23+
<script src="path/to/tc-string-parse.min.js"></script>
2424

2525
<script>
2626
const consentString = ''; // your consent string

package.json

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,32 @@
11
{
22
"name": "tc-string-parse",
3-
"description": "Simple parser for transparency and consent strings compatible with TCF2.0 an.",
4-
"version": "1.1.0",
3+
"description": "Simple parser for transparency and consent strings compatible with TCF2.0.",
4+
"version": "1.1.1",
55
"repository": {
66
"type": "git",
77
"url": "https://github.com/audienceproject/tc-string-parse"
88
},
9-
"keywords": ["tcf", "transparency", "consent", "gdpr", "cmp", "iab"],
9+
"keywords": [
10+
"tcf",
11+
"transparency",
12+
"consent",
13+
"gdpr",
14+
"cmp",
15+
"iab"
16+
],
1017
"license": "Apache-2.0",
1118
"main": "tc-string-parse.js",
1219
"scripts": {
1320
"test": "ava --verbose",
1421
"lint": "eslint .",
15-
"prepublishOnly": "npm install && npm run test && npm run lint"
22+
"compress": "uglifyjs --compress --mangle -- tc-string-parse.js > tc-string-parse.min.js",
23+
"prepublishOnly": "npm install && npm run test && npm run lint && npm run compress"
1624
},
25+
"dependencies": {},
1726
"devDependencies": {
1827
"ava": "3.5.1",
19-
"eslint": "6.8.0"
28+
"eslint": "6.8.0",
29+
"uglify-js": "3.8.1"
2030
},
2131
"engines": {
2232
"node": ">=5.10.0"

0 commit comments

Comments
 (0)