forked from plotly/plotly.js
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpreprocess.js
More file actions
31 lines (24 loc) · 800 Bytes
/
preprocess.js
File metadata and controls
31 lines (24 loc) · 800 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
var fs = require('fs-extra');
var sass = require('node-sass');
var pullCSS = require('./util/pull_css');
var pullFontSVG = require('./util/pull_font_svg');
var constants = require('./util/constants');
// convert scss to css
sass.render({
file: constants.pathToSCSS,
outputStyle: 'compressed'
}, function(err, result) {
if(err) console.log('SASS error');
// css to js
pullCSS(String(result.css), constants.pathToCSSBuild);
});
// convert font svg into js
fs.readFile(constants.pathToFontSVG, function(err, data) {
pullFontSVG(data.toString(), constants.pathToFontSVGBuild);
});
// copy topojson files from sane-topojson to dist/
fs.copy(constants.pathToTopojsonSrc, constants.pathToTopojsonDist,
{ clobber: true },
function(err) {
if(err) throw err;
});