mirror of
https://github.com/sbrl/powahroot.git
synced 2024-11-23 06:33:02 +00:00
Fix resolution logic & tree-shaking
This commit is contained in:
parent
77c7ad2548
commit
be37afb750
7 changed files with 12 additions and 3 deletions
5
.npmignore
Normal file
5
.npmignore
Normal file
|
@ -0,0 +1,5 @@
|
|||
lantern-build-engine/
|
||||
docs/
|
||||
.tern-project
|
||||
logo.piskel
|
||||
logo-large.png
|
2
Client.mjs
Normal file
2
Client.mjs
Normal file
|
@ -0,0 +1,2 @@
|
|||
import ClientRouter from './Client/Router.mjs';
|
||||
export default ClientRouter;
|
|
@ -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
|
||||
});
|
||||
}
|
||||
|
|
|
@ -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
2
Server.mjs
Normal file
|
@ -0,0 +1,2 @@
|
|||
import ServerRouter from './Server/Router.mjs';
|
||||
export default ServerRouter;
|
BIN
logo-large.png
BIN
logo-large.png
Binary file not shown.
Before Width: | Height: | Size: 696 B After Width: | Height: | Size: 317 B |
BIN
logo.png
BIN
logo.png
Binary file not shown.
Before Width: | Height: | Size: 414 B After Width: | Height: | Size: 234 B |
Loading…
Reference in a new issue