FAQ Database Discussion Community


grunt-usemin: ignore a script within build block

gruntjs,grunt-usemin
I have a bunch of scripts that I want to run some tasks on (concat, minify) which I have defined in a block: <!-- build:js js/app.js --> <script src="js/app.js" type="text/javascript"></script> <script src="js/app-dev.js" type="text/javascript"></script> <script src="js/components/inputForm/inputFormControllers.js" type="text/javascript"></script> <script src="js/components/inputForm/inputForm.js" type="text/javascript"></script> <!-- endbuild --> I want to ignore a file within this...

Dynamic image ng-src doesn't change to minified image name

angularjs,gruntjs,minify,grunt-usemin,grunt-contrib-imagemin
I've got two images, a green check mark and a grey check mark. These are shown/hidden as the user checks or unchecks an item in a list. The problem I'm having is that when minifying the app's images with grunt-contrib-imagemin, these two images ng-src doesn't change to the minified image...

Grunt : Usemin prepare, options for cssmin

gruntjs,grunt-usemin,grunt-contrib-cssmin
I'm using usemin in my Grunt file. I'd like to use purifycss. BUT, i get this error when running grunt : Warning: Please check the validity of the CSS block starting from the line #1 Use --force to continue. I think it's because Font Awesome is the first library in...

Grunt filerev, usemin and file caching

angularjs,caching,gruntjs,grunt-usemin
I'm using grunt filerev task to add cachebusters to files when their content changes. usemin task to replace the relevant file path with their revved versions where they are referred. Everything is setup well and they are working as expected / written in their documentation. I'll try to explain the...

Uglify can't parse “flow.js”

bower,grunt-usemin,grunt-contrib-uglify,angular-fullstack,ng-flow
I'm having an annoying issue where uglify (called through grunt-usemin) cannot parse the url for a package named flow.js. This package is installed as a dependency of ng-flow. The url looks like this: bower_components/flow.js/dist/flow.js When I run grunt build, I get the following error: Warning: Unable to read "dist/public/bower_components/flow.js" file...

Grunt config functions omitted

gruntjs,grunt-usemin
I am trying to define a custom function in the useminPrepare configuration, but no matter what I do, the function is eventually omitted in the build. I have updated Node(0.10.36) and NPM(2.4.1) to the latest versions. The config file: useminPrepare: { src: options.dist.dir + '/index.html', options: { dest: options.dist.dir +...

How can I create a regex to match the inner-most match or work from right-to-left?

regex,regex-negation,regex-lookarounds,regex-greedy,grunt-usemin
I'm trying to match the strings for image references but am picking up a little too much when there's an expression involved. In this example http://www.regexr.com/3b3ub, you'll see I'm doing good on the 1st and 3rd matches but I'm getting too much in the 2nd match. I only want the...