fix(build): copy index.d.ts before publish

This commit is contained in:
Adam Bradley
2017-08-10 15:43:29 -05:00
parent 5e999a728f
commit dbf62d7744
3 changed files with 38 additions and 21 deletions

View File

@ -0,0 +1,17 @@
var fs = require('fs');
var path = require('path');
var DIST = path.join(__dirname, '../dist/collection');
var SRC = path.join(__dirname, '../src');
var INDEX_JS_DIST = path.join(DIST, 'index.js');
var INDEX_DTS_SRC = path.join(SRC, 'index.d.ts');
var INDEX_DTS_DIST = path.join(DIST, 'index.d.ts');
console.log('publish: create', INDEX_JS_DIST);
fs.writeFileSync(INDEX_JS_DIST, '');
console.log('publish: create', INDEX_DTS_DIST);
var srcIndexDTS = fs.readFileSync(INDEX_DTS_SRC, 'utf-8');
fs.writeFileSync(INDEX_DTS_DIST, srcIndexDTS);