Skip to content

Commit

Permalink
Add main.js exporting the API functions for bundle
Browse files Browse the repository at this point in the history
Adding a new main JS-file, which only exports the API-functions from the
different source files, so that they can be bundled as a standalone
build.
  • Loading branch information
chrismayer committed Apr 21, 2017
1 parent eed492b commit 777c707
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.2.0-SNAPSHOT",
"description": "JavaScript library to covert geo-features encoded in 'HERE JSON' to GeoJSON",
"scripts": {
"dist": "node ./node_modules/mkdirp/bin/cmd.js dist && browserify -g [ babelify --plugins [ transform-es2015-modules-commonjs ] ] -p [ standalonify --name hj2gj --deps [ null ] ] -g [ bubleify ] src/** > dist/hj2gj.js",
"dist": "node ./node_modules/mkdirp/bin/cmd.js dist && browserify -g [ babelify --plugins [ transform-es2015-modules-commonjs ] ] -p [ standalonify --name hj2gj --deps [ null ] ] -g [ bubleify ] src/main.js > dist/hj2gj.js",
"doc": "node ./node_modules/documentation/bin/documentation.js readme -s API src/{places.js,routing.js,traffic.js,weather.js} --shallow",
"pretest": "eslint ../src & npm run test-bundle",
"test": "mocha test/test-bundle.js",
Expand Down
19 changes: 19 additions & 0 deletions src/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*
here-json2geojson - Convert HERE JSON to GeoJSON object
Copyright 2017-present meggsimum
License: https://github.com/meggsimum/here-json2geojson/blob/master/LICENSE
*/
// This only exports the API functions for the standalone build
import {readIsolines, readRoute} from './routing.js';
import {readTrafficIncidents} from './traffic.js';
import {readWeatherConditions} from './weather.js';
import {readPlaces} from './places.js';

// comment out single unwanted functions for a smaller build
export {
readIsolines,
readRoute,
readTrafficIncidents,
readWeatherConditions,
readPlaces
};

0 comments on commit 777c707

Please sign in to comment.