Add a build step / documentation for code reuse

Trac: 32499
This commit is contained in:
Arlo Breault 2019-11-22 17:17:22 -05:00
parent 3bdcc3408e
commit af4cc52dc2
6 changed files with 75 additions and 13 deletions

View file

@ -39,7 +39,10 @@ var SHARED_FILES = [
];
var concatJS = function(outDir, init, outFile, pre) {
var files = FILES.concat(`init-${init}.js`);
var files = FILES;
if (init) {
files = files.concat(`init-${init}.js`);
}
var outPath = `${outDir}/${outFile}`;
writeFileSync(outPath, pre, 'utf8');
execSync(`cat ${files.join(' ')} >> ${outPath}`);
@ -176,6 +179,11 @@ task('clean', 'remove all built files', function() {
execSync('rm -rf build test spec/support');
});
task('library', 'build the library', function() {
concatJS('.', '', 'snowflake-library.js', '');
console.log('Library prepared.');
});
var cmd = process.argv[2];
if (tasks.has(cmd)) {