HTML import resolver for the npm: scheme
Resolves HTML imports using the npm:
scheme.
<link rel="import" href="npm://@ui/components@1.0.0">
npm i trucks-resolver-npm --save-dev
For the command line interface see trucks-cli.
Register the npm
protocol plugin:
const options {
files: ['npm://@ui/components@1.0.0'],
protocols: ['npm']
}
Resolve npm:
protocols.
public NpmResolver()
Create an npm resolver.
public resolve(cb)
Resolve web component HTML imports from npm packages.
-
cb
Function callback function.
public getCanonicalPath()
Compute the canonical path for the file.
Returns an absolute file system path.
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.
MIT
Created by mkdoc on July 22, 2016