grunt-auto-kissy-module-name

0.1.7 • Public • Published

grunt-auto-kissy-module-name@0.1.6

在编写一个kissy模块的时候,每次都要KISSY.add("在这里把模块所在的路径敲一遍"),很无聊有么有,但是呢生产环境却又确实有必要有这个moduleName,combine需要,性能优化的需要,关乎性能的问题在前端都是大问题!所以......

grunt-auto-kissy-module-name 为此而來。你可以在开发的时候不用写modulename

KISSY.add(function(){

});

在打包的时候运行 grunt-auto-kissy-module-name 来在你指定的目录下面自动给所有文件添加上moduleName

KISSY.add("index" , function(){

});

Getting Started

npm install grunt-auto-kissy-module-name --save-dev

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

grunt.loadNpmTasks('grunt-auto-kissy-module-name');

The "autoname" task

Overview

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

grunt.initConfig({
  autoname: {
    build: {
      // targetDir,要执行的目标目录,一般为打包的build目录
      targetDir : "./build"
    }
  }
});

一般都是在copy到目标目录(build)之后先执行autoname

grunt.registerTask('build', ['clean:build', 'copy' , 'autoname', 'combine', 'uglify', 'cssmin']);

Release History

(Nothing yet)

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.1.7
    3
    • latest

Version History

Package Sidebar

Install

npm i grunt-auto-kissy-module-name

Weekly Downloads

8

Version

0.1.7

License

none

Last publish

Collaborators

  • nickli