Last active
December 17, 2015 13:19
-
-
Save jakeboxer/5616042 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| grunt.initConfig({ | |
| pkg: grunt.file.readJSON('package.json'), | |
| widgetPath: 'public/static/components', | |
| relativeCoffeePath: '**/javascripts/**', | |
| coffee: { | |
| compile: { | |
| files: [ | |
| { | |
| expand: true, | |
| cwd: '<%= widgetPath %>', | |
| src: '<%= relativeCoffeePath %>/*.js.coffee', | |
| dest: '<%= widgetPath %>', | |
| ext: '.js', | |
| rename: function(dest, src){ | |
| return dest + src | |
| } | |
| } | |
| ] | |
| }, | |
| concat: { | |
| dist: { | |
| files: [ | |
| { | |
| expand: true, | |
| cwd: '<%= widgetPath %>', | |
| src: '<%= relativeCoffeePath %>/*.js', | |
| dest: '<%= widgetPath %>', | |
| ext: '.js', | |
| rename: function(dest, src){ | |
| // Split the src into an array of path components | |
| srcComponents = src.split("/") | |
| // Cut out the second to last one | |
| srcComponents.splice(srcComponents.length - 2, 1) | |
| // Join the path components back together into a path | |
| newSrc = "/" + srcComponents.join("/") | |
| return dest + newSrc | |
| } | |
| } | |
| ] | |
| } | |
| } | |
| }, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment