storybook/src/server/utils.js
2016-06-06 13:26:44 +05:30

17 lines
356 B
JavaScript

import path from 'path';
import fs from 'fs';
export function parseList(str) {
return str.split(',');
}
export function getHeadHtml(configDirPath) {
const headHtmlPath = path.resolve(configDirPath, 'head.html');
let headHtml = '';
if (fs.existsSync(headHtmlPath)) {
headHtml = fs.readFileSync(headHtmlPath, 'utf8');
}
return headHtml;
}