use new package script
This commit is contained in:
parent
0e5f677b48
commit
a6c39af39d
2 changed files with 1 additions and 21 deletions
|
@ -4,7 +4,7 @@
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "webpack -w --debug --devtool inline-source-map",
|
"start": "webpack -w --debug --devtool inline-source-map",
|
||||||
"build": "NODE_ENV=production webpack --progress --display-error-details",
|
"build": "NODE_ENV=production webpack --progress --display-error-details",
|
||||||
"package": "npm run build && ./package.sh",
|
"package": "npm run build && node script/package.js",
|
||||||
"lint": "eslint --ext .jsx,.js src",
|
"lint": "eslint --ext .jsx,.js src",
|
||||||
"test": "karma start"
|
"test": "karma start"
|
||||||
},
|
},
|
||||||
|
|
20
package.sh
20
package.sh
|
@ -1,20 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
MANIFEST="manifest.json"
|
|
||||||
|
|
||||||
version=$(jq -r '.version' $MANIFEST)
|
|
||||||
|
|
||||||
icons=$(jq -r '.icons[]' $MANIFEST)
|
|
||||||
content_scripts=$(jq -r '.content_scripts[].js[]' $MANIFEST)
|
|
||||||
background_scripts=$(jq -r '.background.scripts[]' $MANIFEST)
|
|
||||||
web_accessible_resources=$(jq -r '.web_accessible_resources[]' $MANIFEST)
|
|
||||||
options_ui=$(jq -r '.options_ui.page' $MANIFEST)
|
|
||||||
options_scripts=""
|
|
||||||
for html in $options_ui; do
|
|
||||||
scripts=$(grep -Po "(?<=src=['\"])[^'\"]*" "$html")
|
|
||||||
for js in $scripts; do
|
|
||||||
options_scripts="$options_scripts $(dirname $html)/$js"
|
|
||||||
done
|
|
||||||
done
|
|
||||||
|
|
||||||
zip ${version}.zip $MANIFEST $icons $content_scripts $background_scripts $web_accessible_resources $options_ui $options_scripts
|
|
Reference in a new issue