gruntjs

How to configure multi-language site in gruntfile.js?

送分小仙女□ 提交于 2019-12-25 02:26:21
问题 I have a problem that every time I run grunt assemble in the terminal, the task will never complete. Here is my assemble task in gruntfile.js, can someone please tell me if there are anything wrong with it? assemble: { options: { flatten: true, assets: '<%= config.tmp %>/assets', layout: ['<%= config.src %>/templates/layouts/default.hbs'], //data: '<%= config.src %>/data/*.{json,yml}', data: ['<%= config.src %>/data/**/*.{json,yml}'], partials: ['<%= config.src %>/templates/partials/*.hbs'],

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:/

Getting a line number for nodejs errors

耗尽温柔 提交于 2019-12-24 17:17:10
问题 I am writing some code to automate a build process using the Grunt task runner and Node. When there is an error while running a task, it gets displayed without line number or file. This makes finding the actual issue a pain. Example: $ grunt build Running "build" task Warning: Cannot set property '_appConfig' of undefined Use --force to continue. Aborted due to warnings. I am not entirely sure what is responsible for handling these error messages (node, grunt) as I'm quite new to JS

Grunt: including a generated file in usemin

夙愿已清 提交于 2019-12-24 14:42:32
问题 This is the relevant part in my index.html : <!-- build:js scripts/scripts.js --> <script src="scripts/vendor/jquery.js"></script> <script src="scripts/vendor/bootstrap.min.js"></script> <script src="scripts/vendor/handlebars.runtime.js"></script> <script src="scripts/vendor/ember.js"></script> <script src="scripts/vendor/ember-data.js"></script> <script src="scripts/templates.js"></script> <script src="scripts/neuterapp.js"></script> <!-- endbuild --> (but the last two entrires are wrong,

Eclipse Stuck on building workspace after installing Angular js

有些话、适合烂在心里 提交于 2019-12-24 13:42:13
问题 My eclipse stuck while building workspace. The problem started after installing Angular js in a project of eclipse. It's mainly stuck while validating files I installed using "bower" and "Grunt". I installed them in my project using my console from outside of eclipse.If I remove that project,my eclipse again functions normal. Creating another workspace isn't helping. How can I solve this problem without removing Angular js from my project? 回答1: AngularJS Eclipse is based on tern.java which

imagemin for gruntjs used with watch for grunt not properly watching my files

↘锁芯ラ 提交于 2019-12-24 13:02:48
问题 What I would like is the watcher to watch any newly added images and compress ONLY the newly added ones. I would also want it to remove the images I remove from the uncompressed folder (which is images/images/ ), also in the compressed one which is ( images/build/ ), but this doesn't happen. What happens now is, anytime I add an image, Grunt recompresses them all (as in this screenshot: where I added two new images, and it recompresses the whole folder) and if I remove an image from the

grunt dynamic task on watch event

别等时光非礼了梦想. 提交于 2019-12-24 12:33:44
问题 Hi i have a problem i need to watch less tasks for different directory. I need a method to edit the less task and instead to duplicate them i need to use a variable dir inside it. there is my code: module.exports = function(grunt) { grunt.initConfig({ pkg : grunt.file.readJSON('package.json'), dirLess : 'less', dirCss : 'css', dirImages : 'images', dirDT : 'theme-cdt', dirPB : 'theme-cpb', dirMCS : 'theme-cmcs', dirSprites : '<%= dirImages %>/sprites', dirIconFont : './fonts', dirCssMin : '<%

Spawn Grunt tasks in new process

試著忘記壹切 提交于 2019-12-24 11:44:18
问题 I have been using grunt-execute to launch my app.js node server. I also have a grunt watch task. Both of these tasks don't end, they just sit there waiting. The problem is that I need to start both of them. Can I start one in a separate process, or thread (I don't know the correct term) so they can both run at the same time? I have tried grunt-spawn and grunt-shell-spawn but the don't actually launch a separate thing, so the second task never gets run. If I start with the watch, the server

Critical css, above the fold content and rendered views

烂漫一生 提交于 2019-12-24 11:33:52
问题 I'm currently working on my gulp building/deploying pipeline. All the content available on the web about the critical-css-inlining is nice and pretty but it doesn't fit well with real world scenarios where your pages (views) are dinamically assembled. I have: header.html view.html (home.html, about.html, single.html, category.html) footer.html Any web page is a concatenated header + view + footer. Content is not predictable: you cannot know how many articles there will be in a rendered

Grunt won't load the node server

六眼飞鱼酱① 提交于 2019-12-24 10:58:49
问题 My gruntfile.js is: 'use strict'; module.exports = function(grunt) { // Project Configuration grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), watch: { jade: { files: ['app/views/**'], options: { livereload: true, }, }, js: { files: ['gruntfile.js', 'server.js', 'app/**/*.js', 'public/js/**', 'test/**/*.js'], tasks: ['jshint'], options: { livereload: true, }, }, html: { files: ['public/views/**'], options: { livereload: true, }, }, css: { files: ['public/css/**'], options: {