Skip to content

Commit

Permalink
build tooltip support preamble
Browse files Browse the repository at this point in the history
  • Loading branch information
100pah committed Apr 24, 2018
1 parent 52690da commit fdd6008
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion build/helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,11 @@ exports.travelSrcDir = function (srcDir, cb) {
* @param {string} [opt]
* @param {string} [opt.inputPath] Absolute input path.
* @param {string} [opt.outputPath] Absolute output path.
* @param {string} [opt.preamble]
* @param {Function} [opt.transform]
* @param {Function} [opt.reserveDEV]
*/
exports.prePulishSrc = function ({inputPath, outputPath, transform, reserveDEV}) {
exports.prePulishSrc = function ({inputPath, outputPath, preamble, transform, reserveDEV}) {
assert(inputPath && outputPath);

console.log(
Expand All @@ -173,6 +174,10 @@ exports.prePulishSrc = function ({inputPath, outputPath, transform, reserveDEV})
code = transform({code, inputPath, outputPath});
}

if (preamble) {
code = preamble + code;
}

fsExtra.ensureFileSync(outputPath);
fs.writeFileSync(outputPath, code, {encoding:'utf-8'});
};
Expand Down

0 comments on commit fdd6008

Please sign in to comment.