forked from MapKit/Fractal
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.js
More file actions
22 lines (19 loc) · 676 Bytes
/
build.js
File metadata and controls
22 lines (19 loc) · 676 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
var fs = require('fs')
, path = require('path');
var yargs = require('yargs')
, espree = require('espree-js')
, mkdirp = require('mkdirp');
yargs.alias('mixins', 'm')
.alias('output', 'o');
var argv = yargs.parse(process.argv);
var mixins = argv.mixins ?
argv.mixins.split(',') :
['invoke', 'query', 'variables'];
var output = argv.output || 'dist/fractal.js';
// `mixins` is used in index.js to determin what mixins
// should be included in the build.
espree.addGlobal('mixins', mixins);
espree.process('lib/index.js');
// Create dir and write file.
mkdirp.sync(path.dirname(output));
fs.writeFileSync(output, espree.reset());