Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion tasks/util/constants.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,24 @@
var fs = require('fs');
var path = require('path');

var pathToRoot = path.join(__dirname, '../../');
var pathToRootParent = path.join(__dirname, '../../../../');
var pathToSrc = path.join(pathToRoot, 'src/');
var pathToImageTest = path.join(pathToRoot, 'test/image');
var pathToDist = path.join(pathToRoot, 'dist/');
var pathToBuild = path.join(pathToRoot, 'build/');

var pathToTopojsonSrc;

// npm3 flattens modules, so they won't be accessible through the old nested npm2 paths
// attempt a synchronous filestat check, and on error, use the npm3 path
try {
pathToTopojsonSrc = path.join(pathToRoot, 'node_modules/sane-topojson/dist/');
fs.statSync(pathToTopojsonSrc);
} catch (e) {
pathToTopojsonSrc = path.join(pathToRootParent, 'node_modules/sane-topojson/dist/');
}

module.exports = {
pathToRoot: pathToRoot,
pathToSrc: pathToSrc,
Expand All @@ -17,7 +30,7 @@ module.exports = {
pathToPlotlyDistMin: path.join(pathToDist, 'plotly.min.js'),
pathToPlotlyDistWithMeta: path.join(pathToDist, 'plotly-with-meta.js'),

pathToTopojsonSrc: path.join(pathToRoot, 'node_modules/sane-topojson/dist/'),
pathToTopojsonSrc: pathToTopojsonSrc,
pathToTopojsonDist: path.join(pathToDist, 'topojson/'),
pathToPlotlyGeoAssetsSrc: path.join(pathToSrc, 'assets/geo_assets.js'),
pathToPlotlyGeoAssetsDist: path.join(pathToDist, 'plotly-geo-assets.js'),
Expand Down