gruntjs

Errors running Grunt and Sass

强颜欢笑 提交于 2019-12-11 07:58:28
问题 I've been trying to get Sass up and running with Bootstrap. I've followed the tutorial, going so far as to install exact versions of the dependencies listed rather than the default/latest versions. I've done this from scratch at least three times. I've uninstalled and reinstalled different versions of Sass and Compass (mainly according to Sass --compass --watch Error: Cannot load compass), as well as older versions of Ruby (I just installed 2.3.3, down from the latest release). But whenever I

Cordova Build Hooks + Grunt

依然范特西╮ 提交于 2019-12-11 07:53:11
问题 I am trying to link-up my cordova build with grunt, there are a tasks that we run when serving the project locally that I would like to reuse during our Cordova build. For this I create a simple before_build hook and placed it in hooks/before_build. My build hook looks like: #!/usr/bin/env node var grunt = require('grunt'); grunt.tasks(['build']); process.exit(0); The initial part of the build works well, all of the files are copied as expected. However, within my build task, I make several

Grunt: minify js across project of multiple dirs, so that the contents of each dir flattens to a single minified file

一世执手 提交于 2019-12-11 07:43:56
问题 I have a project, with javascript files structured something like this: My goal: I would like to minify/uglify these javascript files in the build output, such as there is 1 minified file per each directory . So for example, if I'm storing the js in my build output in bld/js, then in bld/js, I would end up with files: dir1.min.js (result of concatenating and minifying fileA.js, fileB.js, and all the other js files in /src/js/dir1/), dir2.min.js (result of concatenating and minifying fileG.js

Running package.json dependencies when dependencies are not global

此生再无相见时 提交于 2019-12-11 07:12:42
问题 Let's say I have a package.json with "rimraf" as a dependency in it. "rimraf" is not installed globally. What command, from the command prompt, can I enter to run "rimraf"? Something like "npm run-command rimraf?" 回答1: You'd run ./node_modules/.bin/rimraf or if it is some common task, I'd add it to your package.json : "scripts": { "clean": "rimraf ..." } and then call npm run clean . Commands in scripts automatically resolve with ./node_modules/.bin . 来源: https://stackoverflow.com/questions

Angular 2 with babel ES2015 not loading and no error

谁说我不能喝 提交于 2019-12-11 05:54:36
问题 I'm trying to use angular 2 with babel, grunt, browserify and ES2015 sources. I'm trying a very basic example of simply loading a component with its template into my document. The build run fine and the bundle is created with no error but when loaded nothing happens and I get no error in the console making it hard to debug. I've spent a lot of time trying to figure it out and based from examples I could find online my configuration seemed ok but if it doesn't work clearly I got something

Trouble running Qunit tests with static server using grunt

梦想的初衷 提交于 2019-12-11 05:51:36
问题 Running the tests via a web browser works fine, but using grunt gives me errors. I struggle to understand what I'm doing wrong here. grunt tests fails with $ grunt tests Running "jsonlint:sample" (jsonlint) task >> 4 files lint free. Running "jshint:all" (jshint) task >> 4 files lint free. Running "connect:server" (connect) task Started connect web server on http://localhost:5000 Running "qunit:all" (qunit) task Testing http://localhost:5000/tests/tests.html F >> Settings.json tests -

npm ERR! code EPEERINVALID

喜欢而已 提交于 2019-12-11 05:48:58
问题 I'm new here. I am getting an - npm ERR! code EPEERINVALID (details below), and I am currently running the following: nvm 0.32.1 npm 2.15.9 node v4.5.0 grunt-cli v1.2.0 grunt v0.4.5 And, when doing a package or I guess a module upgrade I am getting the following error... ERR! Linux 3.16.0-30-generic npm ERR! argv "/home/i839211/.nvm/versions/node/v4.5.0/bin/node" "/home/i839211/.nvm/versions/node/v4.5.0/bin/npm" "install" npm ERR! node v4.5.0 npm ERR! npm v2.15.9 npm ERR! code EPEERINVALID

WebStorm 7 - Yeoman Angular missing sourcemaps `Failed to load resource: the server responded with a status of 404 (Not Found)`

孤街浪徒 提交于 2019-12-11 05:46:24
问题 Running the yeoman angular generator grunt server with WebStorm 7.0.1 throws: Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:9000/bower_components/jquery/jquery.js.map:0 Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:9000/bower_components/angular/angular.js.map:0 Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:9000/bower_components/bootstrap-sass/js

How to loop through an array and run a Grunt task passing each value in the array as a Grunt option

若如初见. 提交于 2019-12-11 05:07:43
问题 I have an array similar to the following: var themes = grunt.option('themes') || [ 'theme1', 'theme2', 'theme3' ]; And another variable: var theme = grunt.option('theme') || 'theme1'; This value is used in various places in my grunt file for things such as determining the path to some assets etc. To cut a long story short, I run the following command to compile the assets for a single theme: grunt compile --theme=theme2 I'm looking for a way to loop through the array of themes and run the

Dynamic Build Processes with Grunt.js

微笑、不失礼 提交于 2019-12-11 04:46:19
问题 Is it possible to read a JSON file of child-themes and variables relevant to each one and have a dynamically generated build process via grunt.js? Specifically, I have a standard grunt.initConfig() , for each JSON object in an external themes.json file, I want to repeat the entire build process of the main grunt.initConfig() but I need to pass variables (not always the same) via meta associated with each child theme to the build process. I've spent alot of time working through it and I'm