Skip to content

Commit

Permalink
support exports to node via es5 methods
Browse files Browse the repository at this point in the history
  • Loading branch information
m3talsmith committed Jan 5, 2016
1 parent 8b2280d commit c16a60e
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 2 deletions.
7 changes: 7 additions & 0 deletions RoutePath.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,11 @@ class RoutePath {
}
}

if (typeof module != 'undefined') {
module.exports = {
RoutePath: RoutePath
};
}

export default RoutePath;

8 changes: 7 additions & 1 deletion Router.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import {Channel} from "porter-client";

import RoutePath from "./RoutePath";


class Router {
// Broadcasts {path, search, hash, error, query, tokens}
constructor(channel) {
Expand Down Expand Up @@ -101,4 +100,11 @@ class Router {
}
}

if (typeof module != 'undefined') {
module.exports = {
Router: Router
};
}

export default Router;

11 changes: 11 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,13 @@
import { Router } from './Router';
import {RoutePath } from './RoutePath';

if (typeof module != 'undefined') {
module.exports = {
Router: Router,
RoutePath: RoutePath
};
}

export { default as Router } from './Router';
export { default as RoutePath } from './RoutePath';

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "porter-router",
"version": "0.1.2",
"version": "0.1.3",
"homepage": "https://github.com/agrarianlabs/porter-router#readme",
"description": "A router for porter that acts as a channel to window hash changes and links hash paths to callbacks.",
"keywords": [
Expand Down

0 comments on commit c16a60e

Please sign in to comment.