Skip to content

Commit

Permalink
Simplify build script and move it to separate file (#791)
Browse files Browse the repository at this point in the history
  • Loading branch information
nylen authored May 15, 2017
1 parent 762b618 commit 022d0df
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 11 deletions.
25 changes: 25 additions & 0 deletions bin/build-plugin-zip.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/sh

# Exit if any command fails
set -e

# Change to the expected directory
cd "$(dirname "$0")"
cd ..

# Run the build
npm install
npm run build

# Remove any existing zip file
rm -f gutenberg.zip

# Generate the plugin zip file
zip -r gutenberg.zip \
index.php \
post-content.js \
blocks/build \
editor/build \
element/build \
i18n/build \
README.md
12 changes: 1 addition & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,6 @@
"WordPress",
"editor"
],
"files": [
"index.php",
"post-content.js",
"editor/build",
"i18n/build",
"element/build",
"blocks/build"
],
"scripts": {
"test-unit": "cross-env NODE_ENV=test webpack && mocha build --require bootstrap-test.js",
"build": "cross-env BABEL_ENV=default NODE_ENV=production webpack",
Expand All @@ -26,9 +18,7 @@
"dev": "cross-env BABEL_ENV=default webpack --watch",
"test": "npm run lint && npm run test-unit",
"ci": "concurrently \"npm run build\" \"npm test\"",
"prepackage-plugin": "rm -f gutenberg.zip && npm install && npm run build",
"package-plugin": "cat \"$(npm pack)\" | tar xzf - && cd package && zip -r ../gutenberg.zip *",
"postpackage-plugin": "rm -r package gutenberg*.tgz"
"package-plugin": "./bin/build-plugin-zip.sh"
},
"devDependencies": {
"autoprefixer": "^6.7.7",
Expand Down

0 comments on commit 022d0df

Please sign in to comment.