diff options
author | Mike Morris <michael.patrick.morris@gmail.com> | 2014-07-17 16:49:30 -0400 |
---|---|---|
committer | Mike Morris <michael.patrick.morris@gmail.com> | 2014-07-17 16:49:30 -0400 |
commit | 7fab02d6bd1f10963231184fc37a975daa1fb05c (patch) | |
tree | 778a50c297012053f022ebbd50b953b8bebb325d /bin | |
parent | 4cb9972278c2121a87161e3b02b2071acc1ca8e1 (diff) | |
download | qtlocation-mapboxgl-7fab02d6bd1f10963231184fc37a975daa1fb05c.tar.gz |
split stylesheet fixtures into separate gyp action
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/build-fixtures.js | 22 | ||||
-rwxr-xr-x | bin/build-style.js | 19 | ||||
-rw-r--r-- | bin/package.json | 2 |
3 files changed, 27 insertions, 16 deletions
diff --git a/bin/build-fixtures.js b/bin/build-fixtures.js new file mode 100755 index 0000000000..142147ef88 --- /dev/null +++ b/bin/build-fixtures.js @@ -0,0 +1,22 @@ +#!/usr/bin/env node +'use strict'; + +var load = require('./load-style.js'); +var mkdirp = require('mkdirp'); +var path = require('path'); +var fs = require('fs'); + +var transforms = { + 'fuzz-colors.min.js': require('./fuzz-colors.js'), + 'fuzz-functions.min.js': require('./fuzz-functions.js'), + 'fuzz-layers.min.js': require('./fuzz-layers.js') +}; + +var source = load(process.argv[2]); +var out = process.argv[3]; +mkdirp.sync(out); + +Object.keys(transforms).forEach(function(key) { + source.pipe(transforms[key].call()) + .pipe(fs.createWriteStream(path.join(out, key))); +}); diff --git a/bin/build-style.js b/bin/build-style.js index 4118faa3c8..06d4cc0808 100755 --- a/bin/build-style.js +++ b/bin/build-style.js @@ -1,23 +1,12 @@ #!/usr/bin/env node 'use strict'; -var load = require('./load-style.js'); var mkdirp = require('mkdirp'); var path = require('path'); var fs = require('fs'); -var transforms = { - 'style.min.js': require('./minify.js'), - 'fuzz-colors.min.js': require('./fuzz-colors.js'), - 'fuzz-functions.min.js': require('./fuzz-functions.js'), - 'fuzz-layers.min.js': require('./fuzz-layers.js') -}; +var data = JSON.stringify(require(path.join(process.cwd(), process.argv[2]))); +var out = path.join(process.argv[3], 'style.min.js'); -var source = load(process.argv[2]); -var out = process.argv[3]; -mkdirp.sync(out); - -Object.keys(transforms).forEach(function(key) { - source.pipe(transforms[key].call()) - .pipe(fs.createWriteStream(path.join(out, key))); -}); +mkdirp.sync(path.dirname(out)); +fs.writeFileSync(out, data); diff --git a/bin/package.json b/bin/package.json index 50843fa4b8..01fe883ab3 100644 --- a/bin/package.json +++ b/bin/package.json @@ -4,7 +4,7 @@ "dependencies": { "brfs": "^1.1.2", "fuzzer": "^0.2.0", - "glsl-optimizer": "kkaefer/glsl-optimizer#amalgamation", + "glsl-optimizer": "mapbox/glsl-optimizer#amalgamation", "mkdirp": "^0.5.0", "through2": "^0.5.1" } |