gruntjs

uglified files are not rewritten in html file using gulp-usemin

最后都变了- 提交于 2019-12-09 19:56:08
问题 I am facing a problem with gulp-usemin plugin. when usemin task is running it is concating and uglifying css and js files, but the uglified js files are not rewritten in html file though it is generated. I am sharing my gulpfile.js and index.html code . index.html before conversion <html> <head> <!-- build:css build/css --> <link rel="stylesheet" href="css/blue.css"> <link rel="stylesheet" href="css/green.css"> <link rel="stylesheet" href="css/orange.css"> <!-- endbuild --> <!-- build:js

“Fatal error: Unable to find local grunt.” on Windows 7

浪子不回头ぞ 提交于 2019-12-09 18:22:34
问题 I cannot get grunt to work at all on Windows 7. Following the instructions on the Grunt website (http://gruntjs.com/getting-started) I've run: npm uninstall -g grunt-cli npm uninstall grunt npm uninstall -g grunt-init git clone git@github.com:gruntjs/grunt-init-jquery.git c:/Users/me/.grunt-init/jquery npm install -g grunt-cli grunt-init jquery npm install . After that, running "grunt" produces the following output: grunt-cli: The grunt command line interface. (v0.1.9) Fatal error: Unable to

Development mode for AngularJS using GruntJS

≯℡__Kan透↙ 提交于 2019-12-09 18:01:06
问题 I have a couple of products that started off with the yeoman angular generator, and it has been a pretty good dev setup. One thing I haven't been able to find a good solution for is setting a development/production mode flag. Naturally we use a few tools that we only want on in production so having prod/dev variable that we can use both inline JavaScript and/or HTML files would be quite useful. I searched for solutions online before but haven't found anything useful. Ultimately, I'm looking

Yeoman vendor images paths are incorrect when building the application

寵の児 提交于 2019-12-09 17:14:30
问题 I'm working on an AngularJS application with Yeoman. The application depends on jQuery UI, which is installed with Bower. This is how I include the jQuery UI theme: <!-- build:css styles/plugins.css --> <link rel="stylesheet" href="components/jquery.ui/themes/base/jquery.ui.core.css" /> <link rel="stylesheet" href="components/jquery.ui/themes/base/jquery.ui.accordion.css" /> <link rel="stylesheet" href="components/jquery.ui/themes/base/jquery.ui.autocomplete.css" /> <link rel="stylesheet"

How to use an HTML minifier with underscore templates

只愿长相守 提交于 2019-12-09 16:38:15
问题 I have some templates for my frontend code, like: <div class="row"> <div class="my-header col-md-1"> <!-- comments --> {{ title }} </div> <div class="my-container col-md-11"> {% if (content) { %} {{ content }} {% } else { %} <p>Empty</p> {% } %} </div> </div> And I'm using grunt-contrib-jst to store them all in a single file and then on another build step will be included in a single JS file and that file is pushed to the CDN. This part is working perfectly, but I want to use the

GruntJs 'grunt' cmd opens Visual Studio?

╄→尐↘猪︶ㄣ 提交于 2019-12-09 16:24:12
问题 I have been able to use GruntJs on several personal projects with zero problems. I decided I would use it on my project at work. I run: grunt init:gruntfile and that creates the gruntfile and the package.json file just fine. The problem is that whenever I run any grunt cmd grunt or grunt lint etc it immediately opens up Visual Studio and opens the gruntfile. Nothing actually happens. Any idea what I am doing wrong? 回答1: I didnt read the FAQ... https://github.com/gruntjs/grunt/wiki/Frequently

How to use grunt-html installed globally?

a 夏天 提交于 2019-12-09 15:44:01
问题 I would like to use grunt-html task to check my HTML files. I install the task locally with npm install grunt-html and use it in grunt.js as follows: module.exports = function (grunt) { grunt.loadNpmTasks('grunt-html'); grunt.initConfig({ htmllint:{ all:['*.html'] }, }); }; Now I would like to install the grunt-html task globally . Unfortunately after removing the local grunt-html node module and installing it globally grunt fails to load the task. While running grunt htmllint I get: >> Local

Disable livereload in grunt (yeoman)

独自空忆成欢 提交于 2019-12-09 15:27:06
问题 When I run grunt serve, it automatically injects the following code in in the index.html. <script src="http://x.x.x.x:35729/livereload.js?snipver=1" type="text/javascript"></script> I don't want this to happen. How do I disable it? I tried all the options mentioned here, but it didn't get disable. index.html <!doctype html> <html class="no-js"> <head> <meta charset="utf-8"> <title></title> <meta name="description" content=""> <meta name="viewport" content="width=device-width"> <!-- Place

Use Global Variable to Set Build Output Path in Grunt

会有一股神秘感。 提交于 2019-12-09 12:46:46
问题 I have a couple grunt tasks and I am trying to share global variables across those tasks and I am running into issues. I have written a some custom tasks which set the proper output path depending on the build type. This seems to be setting things correctly. // Set Mode (local or build) grunt.registerTask("setBuildType", "Set the build type. Either build or local", function (val) { // grunt.log.writeln(val + " :setBuildType val"); global.buildType = val; }); // SetOutput location grunt

Using grunt handlebars together with ember, to split templates in separate files

我是研究僧i 提交于 2019-12-09 12:31:34
问题 I am trying to split my ember.js handlebars templates in several files, in order to make the code base more manageable. Since we are using yeoman/grunt, I have come across this handlebars plugin. I have configured it as follows: handlebars: { compile: { options: { namespace: 'JST' }, files: { '<%= yeoman.dist %>/scripts/templates.js': [ '<%= yeoman.app %>/templates/*.hbs' ], } } } As suggested in the "Usage examples" section of the plugin. This is working as expected, generating a dist