grunt-usemin

Usemin not replacing reference blocks in HTML

旧城冷巷雨未停 提交于 2020-01-23 21:03:43
问题 I can see css and js files correctly getting concatenated, revved and copied to the correct folder. The last step though, being usemin replacing the blocks and images in html file, is not working for some reason. The image references in the css file do get replaced. Gruntfile.js: useminPrepare: { html: '<%= yeoman.app %>/index.html', options: { dest: '<%= yeoman.dist %>' } }, // Performs rewrites based on rev and the useminPrepare configuration usemin: { css: ['<%= yeoman.dist %>/styles/{,*/}

Usemin not replacing reference blocks in HTML

陌路散爱 提交于 2020-01-23 21:02:34
问题 I can see css and js files correctly getting concatenated, revved and copied to the correct folder. The last step though, being usemin replacing the blocks and images in html file, is not working for some reason. The image references in the css file do get replaced. Gruntfile.js: useminPrepare: { html: '<%= yeoman.app %>/index.html', options: { dest: '<%= yeoman.dist %>' } }, // Performs rewrites based on rev and the useminPrepare configuration usemin: { css: ['<%= yeoman.dist %>/styles/{,*/}

grunt-usemin not replacing reference block with revved file line

谁都会走 提交于 2020-01-14 13:51:10
问题 I've been having an issue with grunt-usemin where it doesn't replace the non-revved reference block with the single revved line. The two files in the reference block get concatenated and uglified just fine ; the single file metadata.min.js also gets versioned just fine ; but, the reference to the revved file doesn't get inserted in to index.html . Just the non-revved line. I'm using: grunt-usemin 2.6.0 grunt-filerev 2.1.1 the Zend Framework for templating (hence the bizarre template paths)

How to stop minification of js files in grunt?

徘徊边缘 提交于 2020-01-13 08:41:40
问题 I am new to grunt. I have nearly 20-30 js files in my project. I came to know that We are already using grunt to minify and concatenate them. For debug purpose I need to stop minification but retain them in concatenated form. Could any one suggest how to proceed. Any site which has the related tutorials would be helpful.Thanks in advance. module.exports = function(grunt) { var readJSFile = function(data, path){ var finalArray = []; if(path == 'assets/js/'){ finalArray.push('<%= copy.options

How can I run grunt with global path?

[亡魂溺海] 提交于 2019-12-25 01:55:51
问题 When I run 'grunt' at commend line, error occurred 'enable to find local grunt.' Because, in my directory there is no grunt module. I want to run grunt with global path and not contain node_modules in my project folder. The more adding node_modules in my project the slower running a project. In my project, there is only Gruntfile.js except for any other node_modules. How can I run grunt and grunt sub modules with global path? I can't find solution about this problem anywhere. 来源: https:/

HTML comments causing an issue exporting CSS files with Grunt-usemin

泄露秘密 提交于 2019-12-22 22:20:30
问题 I'm using yeoman/grunt to for my build process and I'm running into an issue. I'm trying to build two .css files, one for IE8 and one for everything else. If I place the IE conditional on the outside of the build block, an error is thrown because of the comment within a comment. If I put the IE conditional on the inside it gets stripped out. <!--[if lte IE 8]> <!-- build:css({.tmp,app}) styles/main-old-ie.css --> <link rel="stylesheet" href="styles/main-old-ie.css"> <!-- endbuild --> <![endif

HTML comments causing an issue exporting CSS files with Grunt-usemin

倾然丶 夕夏残阳落幕 提交于 2019-12-22 22:19:04
问题 I'm using yeoman/grunt to for my build process and I'm running into an issue. I'm trying to build two .css files, one for IE8 and one for everything else. If I place the IE conditional on the outside of the build block, an error is thrown because of the comment within a comment. If I put the IE conditional on the inside it gets stripped out. <!--[if lte IE 8]> <!-- build:css({.tmp,app}) styles/main-old-ie.css --> <link rel="stylesheet" href="styles/main-old-ie.css"> <!-- endbuild --> <![endif

grunt-bower-install: exclude certain components

我的梦境 提交于 2019-12-21 08:05:18
问题 I just created a new webapp using the angular-fullstack yeoman generator. I noticed that grunt-bower-install is generating the JS bower components in my index.html files between the <!-- bower:js --> tags. <!-- bower:js --> <script src="bower_components/jquery/dist/jquery.js"></script> <script src="bower_components/angular/angular.js"></script> <script src="bower_components/bootstrap-sass-official/vendor/assets/javascripts/bootstrap/affix.js"></script> <script src="bower_components/bootstrap

GruntJS - wrong image paths after grunt build

孤街醉人 提交于 2019-12-21 02:15:12
问题 Grunt is messing my minified CSS and I cannot figure out why and how to avoid it. To be brief, before the minification I have some background images like this: .head-image { height: 380px; background: url("../images/head1_bg.png") repeat-x; -webkit-background-size: cover; background-size: cover; } Then, after the whole process, I have a minified CSS that goes like this (snippet): [...]background:url(/home/domo/projects/lp/.tmp/images/head1_bg.png) repeat-x;background-size:cover}[...] The

How do I remove some javascript during grunt-usemin compilation

南笙酒味 提交于 2019-12-20 10:35:18
问题 I have code that makes it easy and fast to write/test code, that code does not belong in my production code (mostly it mocks out the server so I only need the grunt server). Two parts to this, one is how to I remove parts of a script angular.module('nglaborcallApp', [ 'ngCookies', 'ngResource', 'ngSanitize', 'ngRoute', 'server_mocks', // Don't want this line in the production build 'dialogs' ] and then a section of index.html that needs to go away <!-- build:js({.tmp,app}) scripts/mocks/mocks