Skip to content

Commit

Permalink
fix: do not re-export pathToRegexp in the ES bundle
Browse files Browse the repository at this point in the history
In the ES module bundle the users may as well just import path-to-regexp themselves.

In the UMD bundle, keep things 'as-is'.
  • Loading branch information
Viktor Lukashov committed Jan 29, 2021
1 parent 8850420 commit c6b476f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 2 additions & 0 deletions index.polyfilled.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import {Router, Resolver} from './index.js';
import * as pathToRegexp from 'path-to-regexp';
Resolver.pathToRegexp = pathToRegexp;

let isUrlAvailable, urlDocument, urlBase, urlAnchor;

Expand Down
3 changes: 0 additions & 3 deletions src/resolver/resolver.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
* LICENSE.txt file in the root directory of this source tree.
*/

import * as pathToRegexp from 'path-to-regexp';
import matchRoute from './matchRoute.js';
import resolveRoute from './resolveRoute.js';
import {toArray, ensureRoutes, isString, getNotFoundError, notFoundResult} from '../utils.js';
Expand Down Expand Up @@ -249,6 +248,4 @@ class Resolver {
}
}

Resolver.pathToRegexp = pathToRegexp;

export default Resolver;

0 comments on commit c6b476f

Please # to comment.