Skip to content

Commit 40c7549

Browse files
committed
add preprocess step to copy topojson assets to dist/
1 parent 8b9a609 commit 40c7549

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363
"delaunay-triangulate": "^1.1.6",
6464
"es6-promise": "^3.0.2",
6565
"fast-isnumeric": "^1.1.1",
66+
"fs-extra": "^0.26.2",
6667
"gl-error2d": "^1.0.0",
6768
"gl-error3d": "^1.0.0",
6869
"gl-line2d": "^1.2.1",

tasks/preprocess.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
var fs = require('fs');
1+
var fs = require('fs-extra');
22

33
var sass = require('node-sass');
44

@@ -22,3 +22,10 @@ sass.render({
2222
fs.readFile(constants.pathToFontSVG, function(err, data) {
2323
pullFontSVG(data.toString(), constants.pathToFontSVGBuild);
2424
});
25+
26+
// copy topojson from sane-topojson to dist/
27+
fs.copy(constants.pathToTopojsonSrc, constants.pathToTopojsonDest,
28+
{ clobber: true },
29+
function(err) {
30+
if(err) throw err;
31+
});

tasks/util/constants.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ module.exports = {
1515
pathToPlotlyDistMin: path.join(pathToDist, 'plotly.min.js'),
1616
pathToPlotlyDistWithMeta: path.join(pathToDist, 'plotly-with-meta.js'),
1717

18+
pathToTopojsonSrc: path.join(pathToRoot, 'node_modules/sane-topojson/dist/'),
19+
pathToTopojsonDest: path.join(pathToDist, 'topojson/'),
1820
pathToPlotlyGeoAssetsSrc: path.join(pathToSrc, 'assets/geo_assets.js'),
1921
pathToPlotlyGeoAssetsDist: path.join(pathToDist, 'plotly-geo-assets.js'),
2022

0 commit comments

Comments
 (0)