Questions tagged [grunt-usemin]

Replace blocks of tags in html files referencing javascript or css files with a single unified file. You can configure usemin to automatically minify css and uglify javascript.

218 questions
65
votes
1 answer

Node glob pattern for every .js file except .spec.js

I am looking for a better glob pattern for usemin, i want to to find all .js files but exclude the .spec.js files. I have the following solution so far. The solution i have at the…
roughcoder
  • 1,190
  • 1
  • 8
  • 11
28
votes
6 answers

Grunt usemin and useminPrepare multiple targets

From the usemin issues it appears that usemin and useminPrepare support multiple targets in the latest version: Support multiple targets in useminPrepare: pull#162 pull#206 usemin support: Multiple targets I've tried using multiple targets…
Răzvan Flavius Panda
  • 21,730
  • 17
  • 111
  • 169
26
votes
1 answer

How to include scripts automatically in a yeoman/grunt project?

I have a working yeoman project. I am using grunt-usemin. To include javascripts, I do this in index.html:
Benjamin Crouzier
  • 40,265
  • 44
  • 171
  • 236
21
votes
9 answers

How should I configure grunt-usemin to work with relative path

I have a grunt project backed by a yeoman-generator that I've built based on the generator-webapp, if it's of any help, you can find it on GitHub The grunt project makes us of the grunt-usemin task. My project involve building a multilingual…
Jérémie Parker
  • 3,184
  • 2
  • 20
  • 33
15
votes
4 answers

Usemin "Different sources attempting to write to the same destination"

I have an AngularJS app I'm working on usemin tasks for. This app has 2 html pages, both include a block minified into a common.js and the other pages include js minified for those specific pages. page1.html tags.
mushroom
  • 1,909
  • 3
  • 16
  • 33
10
votes
5 answers

Grunt usemin: concatenated JavaScript file not replaced in index.html file

I started with an empty project generated by yeoman, and tried to edit the Gruntfile.js to fit my needs. The grunt build task reads my index.html file, and concatenates my bower dependencies and generates a .vendor.js file. I broke something in the…
9
votes
1 answer

usemin on grunt Build is not building bower components properly into dist directory

On Grunt build, how do I capture the proper pathing of bower_components to create a single vendor.js file full of bower components within my dist folder. I've pin pointed the reason, Grunt build's usemin is building vendor.js from the wrong folder…
Armeen Moon
  • 18,061
  • 35
  • 120
  • 233
9
votes
1 answer

How to add separator to Concat options when using Usemin

I am using Grunt-usemin. But the concatenated JS is not properly separated by ';'. How do I tell usemin to add the separator only for JS files but not CSS files? Currently, my usemin tasks look like this: useminPrepare: { options: { …
Codier
  • 2,126
  • 3
  • 22
  • 33
9
votes
1 answer

How to use my own option configurations for concat and uglify with grunt-usemin

For example: Im using the current configuration below to uglify my JS scripts in my Gruntfile: uglify: { options: { report: "min", //"gzip", sourceMap: true, preserveComments: false, //"some", "all" …
Knights
  • 1,467
  • 1
  • 16
  • 24
9
votes
1 answer

Grunt usemin task not working on nested files while minifying angular files

My document structure is root->public->angular->scripts->main->app.js . I have used yeoman angular generator and set up grunt . My html file looks like this
Abhik
  • 1,920
  • 7
  • 27
  • 50
9
votes
2 answers

can grunt automatically include all my js in index.html?

I'm new to grunt. I'm coming from rails and getting into angular. From what I can see grunt usemin can replace