grunt-pathfinder
Find files and process their paths in a template.
Last updated 7 years ago by excellenteasy .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install grunt-pathfinder 
SYNC missed versions from official npm registry.

grunt-pathfinder

Find files and process their paths in a template.

Getting Started

If you haven't used grunt before, be sure to check out the Getting Started guide.

From the same directory as your project's Gruntfile and package.json, install this plugin with the following command:

npm install grunt-pathfinder --save-dev

Once that's done, add this line to your project's Gruntfile:

grunt.loadNpmTasks('grunt-pathfinder');

If the plugin has been installed correctly, running grunt --help at the command line should list the newly-installed plugin's task or tasks. In addition, the plugin should be listed in package.json as a devDependency, which ensures that it will be installed whenever the npm install command is run.

The "importjs" task

Overview

In your project's Gruntfile, add a section named pathfinder to the data object passed into grunt.initConfig().

grunt.initConfig({
  pathfinder: {
    main: {
      files:
        'path/to/output.js': ['some/**/*.js', 'other/whatever.js'],
      template: 'path/to/template.js'
    }
  }
});

Options

The pathfinder task

Overview

Inside your Gruntfile, add a section named pathfinder. This section specifies the possible files to import and the method of importing them.

Settings

There are a number of options available. Please review the minimatch options here. As well as some additional options as follows:

files

Type: object

key:value pair that describes outputFile:filesToImport. This defines where the compiled template output will be saved to (key) where dependencies are looked for (value). Value can be a string or an array of files and/or minimatch patterns.

template

Type: String

The template file will be parsed using grunt.template and the found js dependencies will be passed as data. The dependencies array is available in your template file.

Current Tags

  • 0.3.1                                ...           latest (7 years ago)

4 Versions

  • 0.3.1                                ...           7 years ago
  • 0.3.0                                ...           7 years ago
  • 0.2.0                                ...           7 years ago
  • 0.1.2                                ...           7 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (1)
Dev Dependencies (9)
Dependents (2)

Copyright 2014 - 2016 © taobao.org |