jk-router | A fast and lightweight client side router for JavaScript | Router library
kandi X-RAY | jk-router Summary
kandi X-RAY | jk-router Summary
A fast and lightweight client side router for JavaScript
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of jk-router
jk-router Key Features
jk-router Examples and Code Snippets
Community Discussions
Trending Discussions on jk-router
QUESTION
I have published a npm package : https://www.npmjs.com/package/jk-router
It works fine when using as a classic global variable window.Router
.
But when I try to import it using ES6 syntax in a very basic Meteor app, it does return underfined
...
As you can see, I am using named export (https://github.com/jalik/jk-router/blob/master/src/router.js#L174) and to be sure I am also using default export (https://github.com/jalik/jk-router/blob/master/src/router.js#L559).
But none of the following returns the Router object :
...ANSWER
Answered 2017-Aug-11 at 21:33This is your problem, whenever you publish a NPM package, you need to specify the main file at package.json.
https://github.com/jalik/jk-router/blob/master/package.json#L5
I think that the main property points to wrong file, it should be "router.js" and not "jk-router.js".
If you want your filename to remain "jk-router.js" u can change the output field at webpack.config.js file to "jk-router.js"
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install jk-router
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page