HTTP Resolver
HTML import resolver for the http: and https: schemes.
Resolves HTML imports using the http:
and https:
schemes.
Install
npm i trucks-resolver-http --save-dev
For the command line interface see trucks-cli.
Usage
Register the http
protocol plugin:
const options files: 'https://example.com/components.html'], protocols: 'http' }
API
HttpResolver
Resolve http:
and https:
protocols.
HttpResolver
public
Create an HTTP resolver.
resolve
public
Loads a remote HTTP resource from the network and invokes callback with the response body.
If the response has a Content-Encoding
containing gzip it is deflated.
cb
Function callback function.
http
public
Plugin for the http resolver.
Registers the resolver class for the http:
and https:
protocols unless
the secure
option is given in which case the http:
protocol is not
registered and attempts to use http:
URLs in HTML imports will generate
errors.
state
Object compiler state.conf
Object plugin configuration object.
Options
secure
Boolean=false only usehttps:
.
License
MIT
Created by mkdoc on July 22, 2016