1.0.10 • Published 9 years ago
trucks-resolver-npm v1.0.10
NPM Resolver
HTML import resolver for the npm: scheme
Resolves HTML imports using the npm: scheme.
<link rel="import" href="npm://@ui/components@1.0.0">Install
npm i trucks-resolver-npm --save-devFor the command line interface see trucks-cli.
Usage
Register the npm protocol plugin:
const options {
files: ['npm://@ui/components@1.0.0'],
protocols: ['npm']
}API
NpmResolver
Resolve npm: protocols.
NpmResolver
public NpmResolver()Create an npm resolver.
resolve
public resolve(cb)Resolve web component HTML imports from npm packages.
cbFunction callback function.
getCanonicalPath
public getCanonicalPath()Compute the canonical path for the file.
Returns an absolute file system path.
npm
public npm(state, conf)Plugin for the npm resolver.
Registers the resolver class for the npm: protocol.
stateObject compiler state.confObject plugin configuration object.
License
MIT
Created by mkdoc on July 22, 2016