From 1df32b0a4c693d4029636d399224da7ef5801c10 Mon Sep 17 00:00:00 2001 From: Tony Ganch Date: Thu, 17 Nov 2016 18:33:37 +0100 Subject: [PATCH] [tools] Bring back postinstall script See 3357117329a8c477ced52686e74a7a9dc7cb9b5 --- package.json | 1 + scripts/postinstall.sh | 12 ++++++++++++ 2 files changed, 13 insertions(+) create mode 100755 scripts/postinstall.sh diff --git a/package.json b/package.json index c2244e20..f05ef29c 100644 --- a/package.json +++ b/package.json @@ -21,6 +21,7 @@ "init": "bash ./scripts/init.sh", "lint": "bash ./scripts/lint.sh", "log": "bash ./scripts/log.sh", + "postinstall": "bash ./scripts/postinstall.sh", "prepublish": "bash ./scripts/prepublish.sh", "postpublish": "bash ./scripts/postpublish.sh", "test": "bash ./scripts/test.sh", diff --git a/scripts/postinstall.sh b/scripts/postinstall.sh new file mode 100755 index 00000000..9cc4d3ae --- /dev/null +++ b/scripts/postinstall.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +if [[ ! -d 'lib' ]]; then + npm i webpack@^1.12.2 + npm i json-loader@^0.5.3 + npm i babel-core@^6.18.2 + npm i babel-preset-es2015@^6.18.0 + npm i babel-plugin-add-module-exports@^0.2.1 + npm i babel-loader@^6.2.7 + + ./node_modules/.bin/webpack --module-bind "json=json" --module-bind "js=babel-loader?{'plugins': ['add-module-exports'], 'presets': [['es2015', {'loose': true}]]}" +fi