npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

grunt-conkitty

v0.5.18

Published

Compile Conkitty Templates

Downloads

27

Readme

grunt-conkitty Build Status

Compile Conkitty Templates

Install:

npm install grunt-conkitty --save-dev

Enable:

grunt.loadNpmTasks('grunt-conkitty');

Use (you can omit some of settings):

conkitty: {
    compile: {
        src: ['template1.ctpl', 'template2.ctpl'],
        dest: {
            common: 'path/to/generated/common.js',
            templates: 'path/to/generated/templates.js',
            sourcemap: 'path/to/sourcemap/for/templates.js',
            deps: 'dir/to/copy/dependencies/to'
        }
    }
}

deps is a directory to copy declared in templates dependencies to. For example, let's assume we have two template files. File /path/to/file1.ctpl depends from /path/to/script.js and file /another/path/file2.ctpl depends from /another/path/style.css. If our settings look like:

{
    templates: '/build/path/templates.js',
    deps: '/build/path/deps/'
}

The resulting structure in /build/path will be:

/build/path
    /deps
        1_script.js
        1_script.js_
        2_style.css
        2_style.css_
    templates.js

The dependencies are properly ordered, the files ending with underscore sign (1_script.js_ and 2_style.css_ in our example) contain an absolute path to the source.

You can also save your dependencies as a JSON-file:

{
    templates: '/build/path/templates.js',
    deps: {
        dest: '/build/path/deps/', // Path to copy the files to, the same to the example above.
        file: '/build/path/deps.json' // Path to JSON-file.
    }
}

In addition to previous example result, this one will create deps.json with the following contents:

[
    "/path/to/script.js",
    "/path/to/style.css"
]

Exclude concat.js from the common

By default concat.js is built in the common. You can exclude concat.js from the common:

conkitty: {
    compile: {
        src: ['template1.ctpl', 'template2.ctpl'],
        dest: {
            common: {file: 'path/to/generated/common.js', 'concat.js': false},
            templates: 'path/to/generated/templates.js',
            sourcemap: 'path/to/sourcemap/for/templates.js',
            deps: 'dir/to/copy/dependencies/to'
        }
    }
}

Passing an environment object for precompile expressions

You can pass an environment object for precompile expressions:

conkitty: {
    compile: {
        src: ['template1.ctpl', 'template2.ctpl'],
        dest: {
            env: {prop1: 111, prop2: 'dark', prop3: true},
            common: 'path/to/generated/common.js',
            templates: 'path/to/generated/templates.js'
        }
    }
}