gruntjs

“sudo npm install -g grunt-cli” gives me an error

回眸只為那壹抹淺笑 提交于 2019-12-11 04:35:43
问题 I get an error when trying to install gruntjs on a linux 12.04 (with a mirrored packages source) Here is the error: sudo npm install -g grunt-cli npm ERR! Error: ENOENT, open '/home/havetl/.npm/d63f3d0b-grunt-cli.lock' npm ERR! If you need help, you may report this log at: npm ERR! <http://github.com/isaacs/npm/issues> npm ERR! or email it to: npm ERR! <npm-@googlegroups.com> npm ERR! System Linux 3.5.0-23-generic npm ERR! command "/usr/bin/node" "/usr/bin/npm" "install" "-g" "grunt-cli" npm

Using constants in gruntjs

社会主义新天地 提交于 2019-12-11 04:19:29
问题 I am trying to write my first Grunt task to copy some files from my common libs folder, which is out of my project directory. Project Folder : /home/user/projects/bottle Common Libs directory : /home/user/projects/common Files' source are inside Common Libs directory at : lib/general/static/js/ Files' destination inside project folder : lib I have a properties.json file with Common Libs directory path as shown below { "common_libs" : `/home/user/projects/common` } Now what I already tried is

How to manage bower dependencies when developing and deploying with grunt and a dist project folder?

久未见 提交于 2019-12-11 03:58:26
问题 I am trying to set up a Grunt project with bower dependencies with two tasks: development and deploy . The project folder structure currently looks like this: . ├── bower_components │ ├── animate.css │ ├── jquery │ ├── semantic-ui │ └── wow ├── dist │ └── assets │ ├── styles │ └── js ├── node_modules └── src └── assets ├── less └── js I am currently using grunt-wiredep to automagically include the bower dependencies in the HTML files in dist . I am trying to keep the bower_components out of

grunt task to determine files needed by web app

时光毁灭记忆、已成空白 提交于 2019-12-11 03:53:58
问题 i'am a newbie and started to build a webapp with yeomans webapp generator and a static html 5 template. The template is able to use over 40 plugins. The template directoy structure is like: index.html --assets --css --js --img --plugins --bootstrap --cs --fonts --js ... ... My project only uses a quite little part of it. Is it possible to determine which files are used(referenced) within the project, and copy them automatically with a grunt task to the .tmp and .dist folder? Currently i used

Grunt module(s) to upload all static assets to S3 / CloudFront, replace paths, and invalidate old assets

白昼怎懂夜的黑 提交于 2019-12-11 03:50:17
问题 Using Grunt, NodeJs and Express, what module(s) should I use to: Discover all static assets (frontend JS, CSS, images) in the app, either by looking at an asset directory or parsing through the codebase Upload assets to Amazon S3 / CloudFront, renaming each file with a unique "fingerprinted" name Replace each asset's path in the codebase with the CloudFront URL Invalidate old CDN assets This is my first time using CloudFront. I am not sure if all of the above can be accomplished with Grunt,

GruntFile returns [object, Object]

送分小仙女□ 提交于 2019-12-11 03:48:22
问题 I am using a foundation/jekyll boilerplate. Whenever I run grunt, it only returns the following in my style.css [object Object] It should have processed the scss from the foundation files. Here is the gruntfile.js module.exports = function(grunt) { grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), sass: { options: { includePaths: ['bower_components/foundation/scss'] }, dist: { options: { outputStyle: 'compressed' }, files: { 'css/style.css': 'scss/style.scss' } } }, watch: { grunt:

Unable to build jquery with grunt - submodule error

六眼飞鱼酱① 提交于 2019-12-11 03:44:31
问题 I have no luck building the jQuery (git) using grunt. Everything went smoothly till the actual grunt command which outputs as following: grunt --config Gruntfile.js Running "update_submodules" task TypeError: Cannot call method 'spawn' of undefined at Object.<anonymous> (/Users/maciejbodek/Dropbox/Htdocs/git/jquery/node_modules/grunt-update-submodules/tasks/update-submodules.js:7:14) at Object.task.registerTask.thisTask.fn (/usr/local/lib/node_modules/grunt/lib/grunt/task.js:58:16) at Task.

Unable to generate “dist” folder in yeoman angular generated webapp

跟風遠走 提交于 2019-12-11 03:42:45
问题 I am unable to generate dist folder in the web app built and generated using yeoman angular generator. I am pasting the verbose of grunt build. Please check if this is helpful. pdc1-f3t18r1:ShippingSolution administrator$ grunt --verbose build Initializing Command-line options: --verbose Reading "Gruntfile.js" Gruntfile...OK Registering Gruntfile tasks. Registering "grunt-autoprefixer" local Npm module tasks. Reading /Users/administrator/Desktop/CiscoShipping/ShippingSolution/node_modules

How to get grunt serve task working alongside watch?

烈酒焚心 提交于 2019-12-11 03:19:13
问题 I've recently installed and got a it up and running but I can't seem to get it running concurrently with my watch task? In my grunt file, if register the serve task before watch, the server spins up and but the watch task doesn't....and vice versa. This is the serve package and Im using and Grunt file attached: https://www.npmjs.com/package/grunt-serve module.exports = function(grunt) { // 1. All configuration goes here grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), concat: {

grunt-init template conditional copy files

两盒软妹~` 提交于 2019-12-11 03:16:13
问题 I've just started using grunt-init. I have everything working. And I was wondering if there is a way to do conditional copy root files based on prompts which based on answers to previous prompts. 回答1: You can make use of the rename.json file via the docs. The prop should be the path to the file you want to copy/not copy, and the value can be a template string with a conditional. For example, let's say you had two different main.js files, one empty and one with code you tend to re-use: { "app