New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

grunt-kmc

Package Overview
Dependencies
Maintainers
2
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

grunt-kmc

Grunt plugin for KISSY Module Compiler

  • 0.1.13
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4
increased by33.33%
Maintainers
2
Weekly downloads
 
Created
Source

grunt-kmc

Build Status

NPM version

Grunt plugin for KISSY Module Compiler

Getting Started

This plugin requires Grunt ~0.4.1

If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:

npm install grunt-kmc --save-dev

One the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:

grunt.loadNpmTasks('grunt-kmc');

The "kmc" task

Overview

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

grunt.initConfig({
  kmc: {
    options: {
      // Task-specific options go here.
      // for options, please refer to [kmc](https://github.com/daxingplay/ModuleCompiler).
    },
    your_target: {
      // Target-specific file lists and/or options go here.
    },
  },
})

Options

options.packages

Type: Array Default value: []

KISSY package configuration.

options.charset

Type: String Default value: utf-8

options.comboOnly

Type: Boolean Default Value: false

options.depFilePath

Type: String Default value: ``

dep file output path

options.depFileCharset

Type: String Default value: same as options.charset

output charset.

options.traverse

Type: Boolean Default value: false

build all files in src recursively.

options.fixModuleName

Type:Boolean Default value:false

When combo, module name should be fixed. I suggest you to set this option to true when you combo only.

options.comboMap

Type:Boolean Default value:false

generator one map file

Usage Examples

Simple Example
grunt.initConfig({
  kmc: {
    main:
        options: {
            packages: [
                {
                    name: 'test',
                    path: 'assets/src',
                    charset: 'gbk'
                }
            ]
        },
        files: [{
            src: 'assets/src/test/index.js',
            dest: 'assets/dist/test/index.combo.js'
        }]
  }
})

For detailed options configuration, please refer kmc homepage.

Another Example

Generator the Module Map File Only

grunt.initConfig({
  kmc: {
    main:
        options: {
            packages: [
                {
                    name: 'test',
                    path: 'assets/src',
                    charset: 'gbk'
                }
            ],
			depFilePath:'build/mods.js',
			comboMap:true
        },
        files: [{
            src: 'assets/src/**/*.js',
            dest: 'assets/dist/'
        }]
  }
});

Contributing

In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Grunt.

Release History

  • 0.1.7 bugfix for comboMap
  • 0.1.6 add traverse option.
  • 0.1.5 fix charset output bug.

Keywords

FAQs

Package last updated on 28 Nov 2013

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc