Commit e59feab9 by Wee

fix: default import for `tiny-invariant`

parent 0c35da0a
es es
dist /dist
node_modules node_modules
umd umd
!rollup.config.js !rollup.config.js
/coverage /coverage
/npm-debug.log
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var LiveRoute_1 = require("./LiveRoute");
exports.default = LiveRoute_1.default;
//# sourceMappingURL=index.js.map
\ No newline at end of file
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":";;AAAA,yCAAmC;AAEnC,kBAAe,mBAAS,CAAA"}
\ No newline at end of file
{ {
"name": "react-live-route", "name": "react-live-route",
"version": "3.0.5", "version": "3.0.6",
"description": "A living route for react-router v4", "description": "A living route for react-router v4",
"repository": "fi3ework/react-live-route", "repository": "fi3ework/react-live-route",
"license": "MIT", "license": "MIT",
...@@ -18,19 +18,17 @@ ...@@ -18,19 +18,17 @@
}, },
"peerDependencies": { "peerDependencies": {
"react": ">=16.3", "react": ">=16.3",
"react-router-dom": ">=4" "react-router-dom": ">=4",
"tiny-invariant": ">=1",
"tiny-warning": ">=1"
}, },
"files": [ "files": [
"dist/" "dist/"
], ],
"dependencies": { "dependencies": {
"history": "^4.9.0", "history": "^4.9.0",
"invariant": "^2.2.4",
"prop-types": "^15.6.1", "prop-types": "^15.6.1",
"react-is": "^16.7.0", "react-is": "^16.7.0"
"tiny-invariant": "^1.0.3",
"tiny-warning": "^1.0.2",
"warning": "^4.0.1"
}, },
"devDependencies": { "devDependencies": {
"@types/jest": "^24.0.9", "@types/jest": "^24.0.9",
......
...@@ -5,8 +5,8 @@ import * as React from 'react' ...@@ -5,8 +5,8 @@ import * as React from 'react'
import * as ReactDOM from 'react-dom' import * as ReactDOM from 'react-dom'
import { isValidElementType } from 'react-is' import { isValidElementType } from 'react-is'
import { match, matchPath, RouteComponentProps, RouteProps } from 'react-router' import { match, matchPath, RouteComponentProps, RouteProps } from 'react-router'
import * as invariant from 'tiny-invariant' import invariant from 'tiny-invariant'
import * as warning from 'tiny-warning' import warning from 'tiny-warning'
declare var __DEV__: boolean declare var __DEV__: boolean
...@@ -198,7 +198,7 @@ class LiveRoute extends React.Component<PropsType, any> { ...@@ -198,7 +198,7 @@ class LiveRoute extends React.Component<PropsType, any> {
} = this.props } = this.props
let { children } = this.props let { children } = this.props
const context = { history, location, match, staticContext } const context = { history, location, match, staticContext }
// invariant(context, 'You should not use <Route> outside a <Router>') invariant(context, 'You should not use <Route> outside a <Router>')
const matchOfPath = this.props.path ? matchPath(location.pathname, this.props) : context.match const matchOfPath = this.props.path ? matchPath(location.pathname, this.props) : context.match
const matchOfLivePath = this.isLivePathMatch(livePath, alwaysLive, location!.pathname, { const matchOfLivePath = this.isLivePathMatch(livePath, alwaysLive, location!.pathname, {
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
"strict": true, "strict": true,
"experimentalDecorators": true, "experimentalDecorators": true,
"allowSyntheticDefaultImports": true, "allowSyntheticDefaultImports": true,
"esModuleInterop": true,
"outDir": "dist/", "outDir": "dist/",
"module": "commonjs", "module": "commonjs",
"target": "es5", "target": "es5",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment