trf
trucks-resolver-file
npm i trucks-resolver-file
trf

trucks-resolver-file

Web component compiler and package manager

by muji

1.0.13 (see all)License:MITTypeScript:Not Found
npm i trucks-resolver-file
Readme

File Resolver

HTML import resolver for the file: scheme

Resolves HTML imports using the file: scheme.

<link rel="import" href="file://components.html">

Default resolver for the load plugin.

Install

npm i trucks-resolver-file --save-dev

For the command line interface see trucks-cli.



Usage

This plugin is bundled with the core library so there is no need to add it however the configuration is:

const options {
  files: ['file://components.html'],
  protocols: ['file']
}

For command line usage see trucks-cli.

API

FileResolver

Resolve file: protocols.

FileResolver

public FileResolver()

Create a file resolver.

resolve

public resolve(cb)

Resolves file contents on the local file system using the canonical path assigned to the file property.

  • cb Function callback function.

getCanonicalPath

public getCanonicalPath()

Compute the canonical path for the file.

When the file path is not absolute if this resolver has a parent file then the file is resolved relative to the dirname() of the parent file.

If no parent resolver exists and the path is not absolute it is resolved relative to the current working directory.

If the href begins with an explicit file:// scheme it is stripped.

Returns an absolute file system path.

file

public file(state, conf)

Plugin for the file resolver.

Registers the resolver class for the file: protocol.

  • state Object compiler state.
  • conf Object plugin configuration object.

License

MIT


Created by mkdoc on July 22, 2016

Downloads/wk

36

GitHub Stars

11

LAST COMMIT

6yrs ago

MAINTAINERS

1

CONTRIBUTORS

0

OPEN ISSUES

0

OPEN PRs

0
VersionTagPublished
1.0.13
latest
6yrs ago
No alternatives found
No tutorials found
Add a tutorial

Rate & Review

100
No reviews found
Be the first to rate