gruntjs

Grunt cwd option issue

我的未来我决定 提交于 2019-12-11 12:45:47
问题 I am trying to configure grunt-svg-sprite plugin in my project and as per documentation here http://gruntjs.com/configuring-tasks: cwd All src matches are relative to (but don't include) this path. src Pattern(s) to match, relative to the cwd. And as per https://www.npmjs.com/package/grunt-svg-sprite However, as the path/to/assets would become part of the shape IDs, you will most likely want to add a working directory in most cases: your_target: { expand : true, cwd : 'path/to/assets', src :

Change grunt serve default path

∥☆過路亽.° 提交于 2019-12-11 12:28:12
问题 I use grunt-serve and access the files that it serves through localhost:9000, I want to change that to localhost:9000/mypath I read on the documentation that I can do the following 'serve': { 'path': '/Users/user/Documents/workspace/project' } But I don't know where to put this options. I have found a similar question but no answers. 回答1: The configuration block for the grunt-serve plugin should reside (as with any other task configuration) in the config object passed to grunt.config.init, e

How to add multiple css files in grunt-css?

旧时模样 提交于 2019-12-11 12:16:50
问题 I am using grunt-uncss to remove redundant css from my project. For every HTML page referencing different css files, I am trying to create one css file for every html page. Here I am showing only two files but for real I am working with around 370 files. Here is my current code uncss: { dist: { files: { './newcss/75.css': ['./4dlife/src/app/views/com/twenty/todoPido.html'], './newcss/351.css': ['./4dlife/tools/experiments/index.html'] }, options: { compress:true } } } }); However, the

When running grunt on Windows, I receive “Access is Denied” error with default grunt.js file

邮差的信 提交于 2019-12-11 12:10:37
问题 I'm getting grunt.js setup on a Windows 7 machine. I've got Grunt setup on my %PATH% , but when I try to execute it, I receive this error: C:\project>grunt Access is denied. However, if I rename the grunt file from grunt.js to gruntfile.js and rerun Grunt using the --config flag, it works: C:\project>grunt --config gruntfile.js ...Lots of Grunt output... 5 specs, 0 failures in 0.041s. Done, without errors. My %PATH% is setup with follows: set PATH=.;%NODE_HOME%;%PATH% Any idea why I'm seeing

ng-boilerplate grunt scripts compilation

假如想象 提交于 2019-12-11 12:07:09
问题 I would like to be able to duplicate ng-boilerplate's script compilation process in my own app, but I am unable to get it working. I am referring to having this line in index.html be compiled into a list of all the scripts in my app: <!-- compiled JavaScript --><% scripts.forEach( function ( file ) { %> <script type="text/javascript" src="<%= file %>"></script><% }); %> I added the filterForJS function and registered the multi task in my gruntfile.js, but it is not working :( 回答1: Have you

Karma public api lacks configFile option

血红的双手。 提交于 2019-12-11 12:06:32
问题 gulp-karma suggests an external config file like this: module.exports = { basePath: '', singleRun: true }; I want an external config file like this (grunt-karma style): module.exports = function(config) { config.set({ basePath: '', singleRun: true }); }; How to use the proper config file with karma API. Details: I am using gulp-karma, and as mentioned there, i have to implement it on my own. Karma API is very simple: var server = require('karma').server; server.start(config, done); config

How to have CSS applied to StyleDocco output docs

给你一囗甜甜゛ 提交于 2019-12-11 11:45:14
问题 I am using grunt-styleguide with my template is set to styledocco to generate CSS style guides. When I run the task, it works but the styledocco output files do not have CSS applied to demo elements. My grunt init for styleguide: styleguide: { dist: { options: { framework: { name: "styledocco" }, name: "FE KICKSTARTER V1.o" }, files: { "assets/css/styleguide": "assets/css/**/*.less" } } } My outputs are as follows: Above image, test text and button should have been styles applied. I have

Grunt | Throw Compilation Error to Powershell

心不动则不痛 提交于 2019-12-11 11:40:24
问题 I am trying to call Grunt command from my powershell script. But in case of any complilation failure Grunt is printing the error code to the console but not returning anything to powershell command line and even not going to catch block. Please let me know how to resolve this issue. 回答1: Noah's answer (using $ErrorActionPreference ) can work. Alternatively you can use the automatic variables $? and/or $LastExitCode immediately after executing the external command to take a specific action if

How do I debug within my WebStorm workspace?

三世轮回 提交于 2019-12-11 11:27:25
问题 I start my application on localhost:9000 using a grunt serve command. The application is using yeoman. All my node modules and bower components are in place. I am trying to use the inbuilt grunt task runner - right click and debug serve command. However, it starts the debugger in some other port. I also tried creating run/debug configurations but that does not seem to have a Grunt debug option. I am using WebStorm 11.0.3. Any pointers to do this? 回答1: To debug client-side code of your app

grunt-serve change default path

匆匆过客 提交于 2019-12-11 10:18:54
问题 I am using grunt-serve and trying to change the default path, in my initConfig I use the following serve: { path: '/mypath' }, Then when I visit localhost:9000 I still seeing the files and folders of the gruntfile.js root folder. I want to change the root path to /mypath and make all links relative to that. Also when I visit folder that has an index.html file I want the server to display it. 回答1: You need to set options.serve.path , not path grunt.initConfig({ serve: { options: { serve: {