trucks-resolver-npm
v1.0.10
Published
HTML import resolver for the npm: protocol
Downloads
11
Readme
NPM Resolver
HTML import resolver for the npm: scheme
Resolves HTML imports using the npm:
scheme.
<link rel="import" href="npm://@ui/[email protected]">
Install
npm i trucks-resolver-npm --save-dev
For the command line interface see trucks-cli.
Usage
Register the npm
protocol plugin:
const options {
files: ['npm://@ui/[email protected]'],
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.
cb
Function 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.
state
Object compiler state.conf
Object plugin configuration object.
License
MIT
Created by mkdoc on July 22, 2016