gruntjs

grunt watch and stylus

拈花ヽ惹草 提交于 2019-12-10 21:59:08
问题 can't figure how nesting grunt watch and stylus compiler (livereload will come later) I tried also using the "new" grunt newer, but there must be something wrong in my code. Any suggestion? grunt.initConfig({ stylus: { compile: { options: { paths: ['stylus'], import: [ 'nib/*' ] }, files: { 'css/style.css': 'stylus/style.styl', }, }, }, watch: { stylus: { files: ['*/*.*'], task: ['newer:stylus:compile'], options : { livereload: true }, }, }, }); grunt.loadNpmTasks('grunt-contrib-stylus');

How to configure sourceMaps for LESS using Grunt when there is more than one file in your project?

强颜欢笑 提交于 2019-12-10 21:32:13
问题 I have multiple .less files that I want processed to their matching .css with sourceMaps for each file all in the same folder as the source. How hard can that be? I have no problem in doing this directly with less but cant figure out how to do this in grunt-contrib-less as it seems to want the sourceMapFilename to be a single hard coded value. This my gruntfile: module.exports = function(grunt) { grunt.initConfig({ pkg: grunt.file.readJSON("package.json"), watch: { options: { livereload: true

Grunt build not populate scripts.js with bower_components

為{幸葍}努か 提交于 2019-12-10 21:30:04
问题 I have a problem with the command "grunt build" in my angular application scaffolded using angular-generator 0.10.0, the generated scripts/scripts.xxxx.js does not contain all the js I have in "build:js" block in index.html. This is my current block: <!-- build:js({.tmp,app}) scripts/scripts.js --> <script src="bower_components/handlebars/handlebars.js"></script> <script src="bower_components/alpaca/dist/alpaca/bootstrap/alpaca.js"></script> <script src="bower_components/ace-builds/src

Grunt dynamic dest location sass

≡放荡痞女 提交于 2019-12-10 20:45:32
问题 This could possibly be a repeat question but I couldn't figure out a solution for my requirement I am trying to create a sass grunt task which can generate css files in a dynamic location. Here is my structure /components --> xyz --> scss --> xyz.a.scss --> xyz.b.scss --> abc --> scss --> abc.a.scss --> abc.b.scss Can the grunt task create a new folder relative to its component i.e /components --> xyz --> scss --> xyz.a.scss --> xyz.b.scss --> css --> xyz.a.css --> xyz.b.css --> abc --> scss

Sails is not injecting the files within the assets folder

左心房为你撑大大i 提交于 2019-12-10 20:05:35
问题 I just did a fresh installation of sails (v0.11.0) in my server and after checking this up and working on controllers I found that css, js and templates files included into the assets folders are not being injected to the layout, if there any reason for this to happen? I mean, it is a clean fresh sails installation.... 回答1: In my quest to get SailsJS to auto-inject stylesheets into the layout file under views/layouts/layout.handlebars in my case, I've found out a couple things... When you

grunt: command not found

為{幸葍}努か 提交于 2019-12-10 18:47:01
问题 npm knows that grunt is installed globally, so why isn't it found? $ npm install -g grunt ... installs ... $ npm list -g | grep grunt │ ├─┬ gruntfile-editor@0.2.0 │ ├─┬ gruntfile-editor@0.2.0 ├─┬ grunt@0.4.5 │ ├─┬ grunt-legacy-log@0.1.1 │ ├── grunt-legacy-util@0.2.0 $ grunt -bash: grunt: command not found I assume because it's put it somewhere that is not on my PATH. Why doesn't npm just put it somewhere that is on my PATH by default, like /usr/local/bin ? UPDATE: Weirdly, I get the same

Run grunt task with node.js arguments on Windows

[亡魂溺海] 提交于 2019-12-10 18:23:39
问题 I am running into an out of memory error when running grunt babel. It is solved on mac by increasing max-old-space-size. However some of our developers are on windows machines and I have not found a way to do this on windows. What is the equilevant of: node --max-old-space-size=10000 node_modules/.bin/grunt babel on windows? Or is there a universal command that works on both? My dependencies: "@babel/core": "^7.1.5", "@babel/preset-env": "^7.1.5", "grunt-babel": "^8.0.0", "grunt": "^0.4.5",

How to deploy static website connecting to Django RESTful API?

自作多情 提交于 2019-12-10 18:23:28
问题 First of all, google or SO search didn't help me: lots of tips regarding django's staticfiles, which I believe are not relevant here. I have inherited a project consisting of: Django backend in form of API returning JSON responses only; standard Swampdragon deployment pushing realtime updates to frontend; very little configuration has been done here; Frontend webapp built on Backbone and marionette.js, compiled and minified by Grunt. My problem is: the frontend needs to know addresses for

gruntjs load external config

廉价感情. 提交于 2019-12-10 18:13:38
问题 Ahoy grunt-masters! I would like to load external config files into grunt so that I can do something like this: $ grunt dev:homepage and it would load in homepage-config.json , then run watch $ grunt dev:contact and it would load in contact-config.json , then run watch Each config file would provide a particular setup for tasks: watch, jshint, concat, etc... Inside my Gruntfile I have a task called dev grunt.registerTask('dev', 'loads in external -config.json file, then runs watch', function

Grunt.js for Angular.js dependency injection management

回眸只為那壹抹淺笑 提交于 2019-12-10 17:52:23
问题 I am using Grunt to automatically build my web app. I have run into an interesting issue. I have two options: 1) grunt:dev and 2) grunt:build grunt:dev just does basic tasks related to development. My "main" Angular module looks like this: var myApp= angular.module('myApp', [ "ui.router", "ui.bootstrap", "someDependency", "someDependency2" ]); When I want to build, I do grunt:build . I am using the html2js grunt plugin to prime the Angular cache. However, this method generates a new module