summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore4
-rw-r--r--packages/gitbook/.babelrc3
-rw-r--r--packages/gitbook/.npmignore2
-rwxr-xr-xpackages/gitbook/bin/gitbook.js2
-rw-r--r--packages/gitbook/package.json11
5 files changed, 18 insertions, 4 deletions
diff --git a/.gitignore b/.gitignore
index d4c6405..ff7989f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -27,9 +27,11 @@ node_modules
# vim swapfile
*.swp
+# GitBook with babel
+/packages/gitbook/lib
+
# Output of documentation
_book
-
book.pdf
book.epub
book.mobi
diff --git a/packages/gitbook/.babelrc b/packages/gitbook/.babelrc
new file mode 100644
index 0000000..d4e5f8d
--- /dev/null
+++ b/packages/gitbook/.babelrc
@@ -0,0 +1,3 @@
+{
+ "presets": ["es2015", "react"]
+}
diff --git a/packages/gitbook/.npmignore b/packages/gitbook/.npmignore
new file mode 100644
index 0000000..e04684f
--- /dev/null
+++ b/packages/gitbook/.npmignore
@@ -0,0 +1,2 @@
+src
+!lib
diff --git a/packages/gitbook/bin/gitbook.js b/packages/gitbook/bin/gitbook.js
index 5cadbc9..0492d29 100755
--- a/packages/gitbook/bin/gitbook.js
+++ b/packages/gitbook/bin/gitbook.js
@@ -1,5 +1,5 @@
#! /usr/bin/env node
-/* eslint-disable no-console */
+/* eslint-disable no-console,no-var */
var color = require('bash-color');
diff --git a/packages/gitbook/package.json b/packages/gitbook/package.json
index 7b36ae5..27eda49 100644
--- a/packages/gitbook/package.json
+++ b/packages/gitbook/package.json
@@ -67,7 +67,9 @@
"urijs": "1.18.0"
},
"scripts": {
- "test": "./node_modules/.bin/mocha ./testing/setup.js \"./lib/**/*/__tests__/*.js\" --bail --reporter=list --timeout=10000"
+ "test": "./node_modules/.bin/mocha ./testing/setup.js \"./lib/**/*/__tests__/*.js\" --bail --reporter=list --timeout=10000",
+ "dist": "rm -rf lib/ && babel --presets es2015 -d lib/ src/",
+ "prepublish": "npm run dist"
},
"repository": {
"type": "git",
@@ -95,5 +97,10 @@
"name": "Samy Pessé",
"email": "samy@gitbook.com"
}
- ]
+ ],
+ "devDependencies": {
+ "babel-cli": "^6.14.0",
+ "babel-preset-es2015": "^6.14.0",
+ "babel-preset-react": "^6.11.1"
+ }
}