Skip to content

Commit

Permalink
Fix assets compilation issue with Cloudinary GEM cloudinary/cloudinar…
Browse files Browse the repository at this point in the history
  • Loading branch information
Amir Tocker committed Jun 9, 2016
1 parent 449d720 commit 5ebf54d
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 2,877 deletions.
22 changes: 10 additions & 12 deletions Gruntfile.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,6 @@ module.exports = (grunt)->
src: ['*.coffee']
dest: 'build'
ext: '.js'
legacy:
expand: false
bare: false
sourceMap: true
cwd: '.'
src: 'js/jquery.cloudinary.coffee'
dest: 'js/jquery.cloudinary.js'
ext: '.js'


uglify:
Expand Down Expand Up @@ -128,6 +120,12 @@ module.exports = (grunt)->
copy:
'backward-compatible':
# For backward compatibility, copy jquery.cloudianry.js and vendor files to the js folder
options:
process: (content, srcpath) ->
if /build.cloudinary-jquery-file-upload\.js/.test(srcpath)
content.replace( /\/\/# sourceMappingURL=cloudinary-jquery-file-upload.js.map/g, "")
else
content
files: [
{
expand: true
Expand All @@ -145,8 +143,8 @@ module.exports = (grunt)->
dest: "js/"
}
{
src: 'build/cloudinary-jquery-file-upload.coffee'
dest: 'js/jquery.cloudinary.coffee'
src: 'build/cloudinary-jquery-file-upload.js'
dest: 'js/jquery.cloudinary.js'
}
]
dist:
Expand Down Expand Up @@ -283,8 +281,8 @@ module.exports = (grunt)->
grunt.loadNpmTasks('grunt-version')

grunt.registerTask('default', ['concat', 'coffee'])
grunt.registerTask('compile', ['clean:build', 'clean:js', 'concat', 'copy:backward-compatible', 'coffee', 'copy:dist'])
grunt.registerTask('build', ['clean', 'concat', 'copy:backward-compatible', 'coffee', 'jsdoc'])
grunt.registerTask('compile', ['clean:build', 'clean:js', 'concat', 'coffee', 'copy:backward-compatible', 'copy:dist'])
grunt.registerTask('build', ['clean', 'concat', 'coffee', 'copy:backward-compatible', 'jsdoc'])
grunt.registerTask('lodash', (name, target)->
lodashCalls = grunt.file.read('src/util/lodash.coffee').match(/_\.\w+/g)
include = []
Expand Down
26 changes: 13 additions & 13 deletions Gruntfile.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 5ebf54d

Please sign in to comment.