feat: add uglify

This commit is contained in:
Michal Szczepanski 2023-06-17 08:12:45 +02:00
parent 5a72f848e0
commit 9561a28d42
3 changed files with 28 additions and 6 deletions

25
package-lock.json generated

@ -1,12 +1,12 @@
{ {
"name": "@pinmenote/browser-api", "name": "@pinmenote/browser-api",
"version": "0.0.1", "version": "0.0.4",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "@pinmenote/browser-api", "name": "@pinmenote/browser-api",
"version": "0.0.1", "version": "0.0.4",
"license": "MIT", "license": "MIT",
"devDependencies": { "devDependencies": {
"@parcel/packager-ts": "^2.9.2", "@parcel/packager-ts": "^2.9.2",
@ -22,7 +22,8 @@
"eslint-plugin-prettier": "^4.2.1", "eslint-plugin-prettier": "^4.2.1",
"parcel": "^2.9.2", "parcel": "^2.9.2",
"pre-commit": "^1.2.2", "pre-commit": "^1.2.2",
"typescript": "^4.9.4" "typescript": "^4.9.4",
"uglify-js": "^3.17.4"
} }
}, },
"node_modules/@babel/code-frame": { "node_modules/@babel/code-frame": {
@ -4768,6 +4769,18 @@
"node": ">=4.2.0" "node": ">=4.2.0"
} }
}, },
"node_modules/uglify-js": {
"version": "3.17.4",
"resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.17.4.tgz",
"integrity": "sha512-T9q82TJI9e/C1TAxYvfb16xO120tMVFZrGA3f9/P4424DNu6ypK103y0GPFVa17yotwSyZW5iYXgjYHkGrJW/g==",
"dev": true,
"bin": {
"uglifyjs": "bin/uglifyjs"
},
"engines": {
"node": ">=0.8.0"
}
},
"node_modules/update-browserslist-db": { "node_modules/update-browserslist-db": {
"version": "1.0.11", "version": "1.0.11",
"resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.11.tgz", "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.11.tgz",
@ -8056,6 +8069,12 @@
"integrity": "sha512-Uz+dTXYzxXXbsFpM86Wh3dKCxrQqUcVMxwU54orwlJjOpO3ao8L7j5lH+dWfTwgCwIuM9GQ2kvVotzYJMXTBZg==", "integrity": "sha512-Uz+dTXYzxXXbsFpM86Wh3dKCxrQqUcVMxwU54orwlJjOpO3ao8L7j5lH+dWfTwgCwIuM9GQ2kvVotzYJMXTBZg==",
"dev": true "dev": true
}, },
"uglify-js": {
"version": "3.17.4",
"resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.17.4.tgz",
"integrity": "sha512-T9q82TJI9e/C1TAxYvfb16xO120tMVFZrGA3f9/P4424DNu6ypK103y0GPFVa17yotwSyZW5iYXgjYHkGrJW/g==",
"dev": true
},
"update-browserslist-db": { "update-browserslist-db": {
"version": "1.0.11", "version": "1.0.11",
"resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.11.tgz", "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.11.tgz",

@ -12,8 +12,10 @@
"module": "dist/module.js", "module": "dist/module.js",
"types": "dist/types.d.ts", "types": "dist/types.d.ts",
"scripts": { "scripts": {
"build": "parcel build", "build": "npm run prod && npm run uglify",
"dev": "NODE_ENV=development parcel build", "dev": "NODE_ENV=development parcel build",
"prod": "parcel build --no-source-maps",
"uglify": "uglifyjs --compress --mangle -o dist/module.js -- dist/module.js",
"lint": "eslint --ext .ts src/", "lint": "eslint --ext .ts src/",
"lint:fix": "eslint --ext .ts,.tsx src/ --fix" "lint:fix": "eslint --ext .ts,.tsx src/ --fix"
}, },
@ -34,6 +36,7 @@
"eslint-plugin-prettier": "^4.2.1", "eslint-plugin-prettier": "^4.2.1",
"parcel": "^2.9.2", "parcel": "^2.9.2",
"pre-commit": "^1.2.2", "pre-commit": "^1.2.2",
"typescript": "^4.9.4" "typescript": "^4.9.4",
"uglify-js": "^3.17.4"
} }
} }

@ -3,6 +3,6 @@
"compilerOptions": { "compilerOptions": {
"target": "es2021", "target": "es2021",
"types": ["node", "firefox-webext-browser", "chrome"], "types": ["node", "firefox-webext-browser", "chrome"],
"typeRoots": ["node_modules/@types", "@types"] "typeRoots": ["node_modules/@types"]
} }
} }