knex/scripts/build.sh
Rhys van der Waerden f320906577 Read version from package.json
Means that it's impossible to have `Knex#VERSION` and the version in `package.json` out of sync. This is one less thing to do for release.

This required the addition of `json-loader` for webpack. I've also added webpack to `devDependencies` rather than installing it manually during the `build` script.
2016-05-15 21:38:34 +10:00

20 lines
346 B
Bash
Executable File

#!/bin/bash -e
rm -rf tmp
mkdir tmp
rm -rf build
mkdir build
rm -rf lib
mkdir lib
npm run babel
cp -r lib tmp/lib
cp knex.js tmp
node -p 'p=require("./package");p.main="lib";p.scripts=p.devDependencies=undefined;JSON.stringify(p,null,2)' > tmp/package.json
$(npm bin)/webpack --config scripts/webpack.config.js tmp build/knex.js
rm -rf tmp