jwvdiermen / grunt-include-source

Include lists of files into your source files automatically.
MIT License
68 stars 31 forks source link

Add support for "target" include option. #39

Closed mgierw closed 9 years ago

mgierw commented 9 years ago

I wanted to write something like the following:

<!-- include: "target": "dev", "type": "js", "files": ["dist/lib/*.js", "dist/js/gameApp.js", "dist/js/*.js", "dist/shared/*.js"] -->
<!-- include: "target": "prod", "type": "js", "files": ["dist/client.min.js"] -->

where include is conditionally executed according to the task target. My grunfile.js is:

includeSource: {
    options: {
        basePath: './',
        baseUrl: '',
        templates: {
            html: {
                js: '<script src="{filePath}"></script>'
            }
        }
    },
    dev: {
        files: {
            'dist/dev/game.html': 'html/game.html'
        }
    },
    prod: {
        files: {
            'dist/prod/game.html': 'html/game.html'
        }
    }
}
jwvdiermen commented 9 years ago

Seems easy enough, merged and published the changes.