1
0
Fork 0
mirror of https://github.com/sbrl/powahroot.git synced 2024-06-14 17:44:56 +00:00

Fix resolution logic & tree-shaking

This commit is contained in:
Starbeamrainbowlabs 2019-04-28 21:19:30 +01:00
parent 77c7ad2548
commit be37afb750
Signed by: sbrl
GPG key ID: 1BE5172E637709C2
7 changed files with 12 additions and 3 deletions

5
.npmignore Normal file
View file

@ -0,0 +1,5 @@
lantern-build-engine/
docs/
.tern-project
logo.piskel
logo-large.png

2
Client.mjs Normal file
View file

@ -0,0 +1,2 @@
import ClientRouter from './Client/Router.mjs';
export default ClientRouter;

View file

@ -58,7 +58,7 @@ class ClientRouter extends EventEmitter {
add_page(routespec, callback) {
this.routes.push({
spec: routespec,
match: pathspec instanceof RegExp ? { regex: routespec, tokens: [] } : pathspec_to_regex(routespec),
match: routespec instanceof RegExp ? { regex: routespec, tokens: [] } : pathspec_to_regex(routespec),
callback
});
}

View file

@ -36,7 +36,7 @@ Syntax | Meaning
Initialise a new router like this:
```js
import { ClientRouter } from 'powahroot';
import ClientRouter from 'powahroot/Client.mjs';
// ....
@ -51,7 +51,7 @@ const router = new ClientRouter({
The server router works slightly differently, to account for the different environment it's designed for. Here's how to use it:
```js
import { ServerRouter } from 'powahroot';
import ServerRouter from 'powahroot/Server.mjs';
// ....

2
Server.mjs Normal file
View file

@ -0,0 +1,2 @@
import ServerRouter from './Server/Router.mjs';
export default ServerRouter;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 696 B

After

Width:  |  Height:  |  Size: 317 B

BIN
logo.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 414 B

After

Width:  |  Height:  |  Size: 234 B