node package manager
Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »



if necessary, converts all files within the directory, and the remaining copies.. Then, change path in html files to new converted and copied files Supports all plug-ins which you can specify the SRC and DEST

Getting Started

This plugin requires Grunt.

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-smart-assets --save-dev

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


The "smart_assets" task


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

  smart_assets: {
      options: {
        files: {
            cwd: 'test-app/app',
            dest: 'test-app/dist',
            cleanDist: true,
            src: '**/*' //available by default 
            //if need transformation 
            streamTasks: {
                coffee: {
                    from: ['.coffee'],
                    to: '.js',
                    options: {
                        sourceMap: true,
                        bare: true
                sass: {
                    from: ['.sass', '.scss'],
                    to: '.css'
            afterTasks: {
                autoprefixer: {
                    src: ['**/*.css', '!**/library/**'],
                    options: { map: true }
            cwd: 'test-app/html',
            dest: 'test-app/html-dest',
            src: '*.html',
            assetDir: 'test-app'
            rev: true



Type: Object

Tasks to be performed for each file in the specified folder according to the extension


Type: Object

If you need something to do with the files after converting and copying


Type: Bool Default value: true

Clean dist folder before convert`


Type: Bool Default value: false

Add ?md5(file) to file name


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

(Nothing yet)


Copyright (c) 2014 Shapovalov Alexandr. Licensed under the MIT license.