feat: add uglify

This commit is contained in:
Michal Szczepanski 2023-06-17 08:14:24 +02:00
parent e10de72fbc
commit 09a6db2703
3 changed files with 26 additions and 3 deletions

21
package-lock.json generated
View File

@ -20,7 +20,8 @@
"eslint-plugin-prettier": "^4.2.1", "eslint-plugin-prettier": "^4.2.1",
"parcel": "^2.8.3", "parcel": "^2.8.3",
"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": {
@ -4309,6 +4310,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.10", "version": "1.0.10",
"resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.10.tgz", "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.10.tgz",
@ -7331,6 +7344,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.10", "version": "1.0.10",
"resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.10.tgz", "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.10.tgz",

View File

@ -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"
}, },
@ -32,6 +34,7 @@
"eslint-plugin-prettier": "^4.2.1", "eslint-plugin-prettier": "^4.2.1",
"parcel": "^2.8.3", "parcel": "^2.8.3",
"pre-commit": "^1.2.2", "pre-commit": "^1.2.2",
"typescript": "^4.9.4" "typescript": "^4.9.4",
"uglify-js": "^3.17.4"
} }
} }

View File

@ -4,6 +4,7 @@
"target": "es2021", "target": "es2021",
"strict": true, "strict": true,
"types": ["node"], "types": ["node"],
"moduleResolution": "node",
"typeRoots": ["node_modules/@types"] "typeRoots": ["node_modules/@types"]
} }
} }