1.0.5 • Published 10 years ago

trucks-transform-copy v1.0.5

Weekly downloads
3
License
MIT
Repository
github
Last release
10 years ago

Copy Transform

Copy files into the output directory

Install

npm i trucks-transform-copy --save-dev


Usage

Use the copy key to configure this transform:

const trucks = require('trucks');

trucks(
  {
    files: ['components.html'],
    transforms: ['copy'],
    copy: {
      files: {
        'src/index.html': 'index.html'
      }
    }
  }, (err, res) => {
    if(err) {
      throw err; 
    }
    console.log(res);
  }
);

API

copy

public copy(state, conf)

Copy input files to the output directory.

Files are defined using an input mapping:

{
  copy: {
    files: {
      'src/index.html': 'index.html'
    }
  }
}

Input files are the keys and are resolved relative to the base option. The values are output paths relative to the compiler output directory.

Returns map of visitor functions.

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

Options

  • files Object map of files to copy.
  • base String base path for relative input files.

License

MIT


Created by mkdoc on August 2, 2016

1.0.5

10 years ago

1.0.4

10 years ago

1.0.3

10 years ago

1.0.2

10 years ago

1.0.0

10 years ago