gruntjs

Can Grunt Lodash Templates Be Used In Gruntfile.js tasks?

安稳与你 提交于 2019-12-24 08:16:17
问题 Is there a way to use grunt lodash templating in gruntfile.js tasks so I can use functions like .toLowerCase(). The below snippet doesn't work, maybe it doesn't work this way since I can't find an example that fits this use case. copy: { plugins: { files: [{ src: ['<%= root %>/<%= dirs.plugins %>/<%= pkg.name.toLowerCase() %>'], dest: '<%= root %>/<%= dirs.www %>/wp-content/plugins/<%= pkg.name %>', }] } } 回答1: Use the evaluate delimiter <% plus the String() constructor to use toLowerCase :

Understanding gruntjs registerTask colon

梦想与她 提交于 2019-12-24 08:10:24
问题 I'm currently trying to learn gruntjs for dev and production build. I want to assign a global config variable to determine stuff. I have a simple initConfig : grunt.initConfig({ foo: { bar: {GLOBAL: true}, baz: {GLOBAL: false} } }); grunt.registerTask('one', ['foo:bar']); grunt.registerTask('two', ['foo:baz']); My question is: What exactly is the colon in my tasks doing? ( foo:bar or foo:baz ) And what is the difference between a colon and a simple dot? My Goal is to have a global variable

grunt task uglify errors >> TypeError: Object #<Object> has no method 'isAbsolute'

谁都会走 提交于 2019-12-24 06:04:44
问题 I am running grunt cssmin it shows error >> TypeError: Object #<Object> has no method 'isAbsolute' Warning: CSS minification failed at node_modules/bootstrap/dist/css/bootstrap.mi n.css. Use --force to continue. Aborted due to warnings. : grunt_default F AILED FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':grunt_default'. > Process 'command 'C:...\nodejs\node-v0.10.22-windows-x64\bin\node.exe'' finished with non-zero exit value 6 Grunt Code part is

Error: $compile:tpload failed to load template Http status : 404

ぐ巨炮叔叔 提交于 2019-12-24 05:04:33
问题 I'm getting a 404 status from Chrome when i'm trying to run a local project using angular. I'm not sure where the problem is and i've already tried the suggested answers to similar questions. This is my directives file: 'use strict'; /** * @ngdoc directive * @name stockDogApp.directive:stkWatchlistPanel * @description * # stkWatchlistPanel */ angular.module('stockDogApp') .directive('stkWatchlistPanel', function ($location, $modal, WatchlistService) { return { templateUrl: 'views/templates

Have Grunt include different Javascript files in development and production

感情迁移 提交于 2019-12-24 05:02:03
问题 I'm trying out Grunt and have a question about including javascript files in dev and later stages. For clarification: the minify, concatenation, etc is not the problem here - just the output/replacement. In the dev stage I want to include javascript libraries and files individual - for debugging, maybe just because I did so all time and somehow I don't like them to be concatenated in dev. So in I want the following output in my HTML file when developing: <script src="js/lib-1.js"></script>

Have Grunt include different Javascript files in development and production

烂漫一生 提交于 2019-12-24 05:01:44
问题 I'm trying out Grunt and have a question about including javascript files in dev and later stages. For clarification: the minify, concatenation, etc is not the problem here - just the output/replacement. In the dev stage I want to include javascript libraries and files individual - for debugging, maybe just because I did so all time and somehow I don't like them to be concatenated in dev. So in I want the following output in my HTML file when developing: <script src="js/lib-1.js"></script>

grunt-contrib-connect works only with keepalive

[亡魂溺海] 提交于 2019-12-24 04:49:06
问题 Something strange happens, when I try to connect to server. There are no errors in terminal, it says "Started connect web server on http://0.0.0.0:5555" , then done without errors. But when I serf to http://localhost:5555/ - I get typical "page not found". In chrome console one warning and one error: i18n-values: Missing value for "primaryParagraph" http://localhost:5555/:1 GET http://localhost:5555/ net::ERR_CONNECTION_REFUSED The more surprising is that when I define keepalive:true

Pass Grunt config options from task.run

别等时光非礼了梦想. 提交于 2019-12-24 04:22:33
问题 Tried a few things and cannot seem to get this to work, but I would have thought it was something quite simple. I am trying to pass a variable|option into a Grunt initialize config when the task is run. At the minute I have two separate configs: sass: { dev: { options: { style: 'expanded' }, files: [{ expand: true, cwd: source + 'scss/', src: '*.scss', dest: destination + 'css', ext: '.css' }] }, production: { options: { style: 'compressed' }, files: [{ expand: true, cwd: source + 'scss/',

SailsJS: Requiring Assets, Such As, sails.io.js

混江龙づ霸主 提交于 2019-12-24 03:52:45
问题 As the problem is short & sweet, I'll keep the question so. CAN'T LOAD ASSETS. Using Sails.js ( v0.11.n ). Can't load assets... That's about it... I'm trying to load sails.io.js -- or now even just assets/alert.js . <script type="text/javascript" src="/js/dependencies/sails.io.js"></script> Doesn't work :( Even when I switch the src to /alert.js -- nothing. I'm pasting this script tag inside of my /signup view -- which loads fine -- but I know sure as heck I'm doing something(s) wrong. 回答1:

SailsJS: Requiring Assets, Such As, sails.io.js

試著忘記壹切 提交于 2019-12-24 03:52:04
问题 As the problem is short & sweet, I'll keep the question so. CAN'T LOAD ASSETS. Using Sails.js ( v0.11.n ). Can't load assets... That's about it... I'm trying to load sails.io.js -- or now even just assets/alert.js . <script type="text/javascript" src="/js/dependencies/sails.io.js"></script> Doesn't work :( Even when I switch the src to /alert.js -- nothing. I'm pasting this script tag inside of my /signup view -- which loads fine -- but I know sure as heck I'm doing something(s) wrong. 回答1: