forked from justinribeiro/speedometer-pwa
-
Notifications
You must be signed in to change notification settings - Fork 1
/
package.json
31 lines (31 loc) · 1.94 KB
/
package.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
{
"name": "speedometer",
"description": "Simple speedometer progressive web app based on Geolocation API and AmbientLightSensor API",
"version": "1.0.0",
"main": "index.js",
"author": "Justin Ribeiro <justin@justinribeiro.com>",
"bugs": {
"url": "https://github.com/justinribeiro/speedometer-pwa/issues"
},
"repository": {
"type": "git",
"url": "git@github.com:justinribeiro/speedometer-pwa.git"
},
"license": "MIT",
"scripts": {
"clean": "rm -rf ./dist/ && mkdir ./dist/",
"copy": "cp -R ./src/* ./dist/",
"build:js": "yarn google-closure-compiler --js=./src/index.js --js_output_file=./dist/index.js --compilation_level=ADVANCED --jscomp_off=checkVars --language_out=ECMASCRIPT_2017",
"build:sw": "yarn google-closure-compiler --js=./src/service-worker.js --js_output_file=./dist/service-worker.js --compilation_level=ADVANCED --jscomp_off=checkVars --allow_method_call_decomposing --language_out=ECMASCRIPT_2017",
"build:inline:css": "sed -i -e '/<link rel=\"stylesheet\" href=\"index.css\">/{' -e 'a <style>' -e 'r ./dist/index.css' -e 'a </style>' -e 'd}' ./dist/index.html",
"build:inline:js": "sed -i -e '/<script src=\"index.js\"><\\/script>/{' -e 'a <script>' -e 'r ./dist/index.js' -e 'a </script>' -e 'd}' ./dist/index.html",
"build:minify": "yarn html-minifier --collapse-whitespace --remove-comments --remove-optional-tags --remove-redundant-attributes --removeAttributeQuotes --remove-tag-whitespace --removeOptionalTags --minify-css true --output ./dist/index.html ./dist/index.html",
"build:smaller": "rm -rf ./dist/*.css && rm -rf ./dist/index.js",
"dist": "yarn clean && yarn copy && yarn build:js && yarn build:sw && yarn build:inline:css && yarn build:inline:js && yarn build:minify && yarn build:smaller",
"dist:analytics": "yarn dist && cat ./analytics.txt >> ./dist/index.html"
},
"devDependencies": {
"google-closure-compiler": "^20181125.0.1",
"html-minifier": "^3.5.21"
}
}