gruntjs

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/{,*/}

Angular / grunt failed to load template

馋奶兔 提交于 2020-01-23 09:54:17
问题 I recently introduced angular directives into my yeoman app for templating, and everything works fine if I grunt serve the normal dev version of the app, but when I build the 'dist' folder with grunt and serve it, the html in the directives of my app don't appear on the page and the console logs this error: Failed to load resource: the server responded with a status of 404 (Not Found) vendor.6e8f248d.js:5 Error: [$compile:tpload] Failed to load template: /views/tabdir.html (HTTP status: 404

Can the gruntjs watch be restarted on grunt.js file change

亡梦爱人 提交于 2020-01-23 04:39:09
问题 Can the grunt watch be restarted when ever there is a change in grunt.js file use case: I am right now in the process of building my grunt process and keep changing the grunt.js file and I have to restart the grunt.js to see if it works. 回答1: It looks like this was implemented in version 0.4.0 . You can see the issue here which explains that by simply watching the Gruntfile (even without any tasks) the entire contents of the Grunt setup will be reloaded: watch: { grunt: { files: ['grunt.js']

grunt: how to replace paths in html file using grunt task

梦想的初衷 提交于 2020-01-19 23:30:49
问题 inside my grunt configuration if have a variable which defines a directory which contains a css file. Now I would like to configure a grunt task which insert the value of this variable into a html file. For example, I can imagine that I have an index.html file as follows <!doctype html> <head> <link rel="stylesheet" href="<% pathToCss %>/styles.css"> ... But I cannot find a task which can do that for me. Any suggestions which grunt taks can do this for me ? 回答1: I just found out that it can

How do I manage relative path aliasing in multiple grunt-browserify bundles?

孤街浪徒 提交于 2020-01-19 06:52:51
问题 This is tad long but I'll need the code example to illustrate my confusion. After which I am interested to the answer for the following: How do I use require('module') instead of require('../../src/module') or require('./module') ? How do I reuse ./index.js in spec/specs.js without duplicating work? (And preventing src/app.js from running as it's an entry module). I've started several browser based projects already and love browserify and grunt. But each project dies at the same point in my

Not possible to use the latest ember with pre-compiled templates

青春壹個敷衍的年華 提交于 2020-01-17 08:35:51
问题 I have just installed the latest ember starter kit. It has: Ember.VERSION : 1.0.0-rc.5 Handlebars.VERSION : 1.0.0-rc.4 jQuery.VERSION : 1.9.1 I am using grunt-contrib-handlebars@0.5.9 to pre-compile my templates (this is the latest version available). I do not know what version of handlebars is included in that package, but I get the following error when starting the application: Uncaught Template was precompiled with an older version of Handlebars than the current runtime. Please update your

Not possible to use the latest ember with pre-compiled templates

廉价感情. 提交于 2020-01-17 08:35:08
问题 I have just installed the latest ember starter kit. It has: Ember.VERSION : 1.0.0-rc.5 Handlebars.VERSION : 1.0.0-rc.4 jQuery.VERSION : 1.9.1 I am using grunt-contrib-handlebars@0.5.9 to pre-compile my templates (this is the latest version available). I do not know what version of handlebars is included in that package, but I get the following error when starting the application: Uncaught Template was precompiled with an older version of Handlebars than the current runtime. Please update your

Yeoman grunt not copying styles task

|▌冷眼眸甩不掉的悲伤 提交于 2020-01-17 03:11:05
问题 I am getting error when i run grunt build. Whats would be the cause? gruntfile.js: // Generated on 2016-04-28 using generator-angular 0.15.1 //cwd - All src matches are relative to (but don't include) this path. 'use strict'; // # Globbing // for performance reasons we're only matching one level down: // 'test/spec/{,*/}*.js' // use this if you want to recursively match all subfolders: // 'test/spec/**/*.js' module.exports = function (grunt) { // Time how long tasks take. Can help when

How to implement Compass, Sass to a node.js project?

瘦欲@ 提交于 2020-01-16 18:37:14
问题 i have recently implemented the grunt task runner on my Node.js project and i'm using grunt-contrib-compass and grunt-contrib-watch in order to compile my sass and compass code through grunt whenever i make any changes. My grunt file is like this:- module.exports = function(grunt) { grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), compass: { dist: { options: { sassDir: 'public/sass', cssDir: 'public/css' } } }, watch: { css: { files: '**/*.scss', tasks: ['compass'] } } }); grunt