gruntjs

How can I force JSHint running in grunt to always use the --verbose flag

一笑奈何 提交于 2019-12-05 06:00:15
I have a particular JSHint/Grunt setup in which I would like to accomplish the following: Load from a single .jshintrc file to allow my IDE linter to pick up my settings Be able to override single options from the .jshintrc in other grunt tasks Have JSHint always run in verbose mode so that I can always see the warning numbers, without needing to run all of grunt with --verbose The following allows me to load from the .jshintrc and always run in verbose, but does not allow option overrides. The docs mention that this should be the case, but don't say anything about the verbose option, which

grunt requirejs ignores paths from my mainConfigFile

跟風遠走 提交于 2019-12-05 05:45:48
Project Intro My project is a single page storefront. The project has multiple modules, and each module contains a set of controller.js, view.js and model.js files, as well as a template.html file. And uses requirejs to manage dependencies. Problem Statement I want to use mainConfigFile to provide paths to reference modules in grunt-requirejs. Part of my mainConfigFile's require.config is stored in separate file (base.dependency.config), and require.config.paths are pieced together by underscore at runtime. base.dependency.config config = { baseDependencyConfig: { paths: { ... } shim: { ... }

How do I automate the task of compiling front-end frameworks like Twitter Bootstrap in my Node.js project?

不想你离开。 提交于 2019-12-05 05:45:35
How do I automate the task of compiling Twitter Bootstrap in my Node.js project? I'm editing the LESS files that compile into a custom build of Bootstrap for my Node.js project, so I can't just use the online customizer or the pre-compiled JavaScript/CSS distribution. How do I use something like Grunt or Bower to automate the process of building and compiling the Twitter Bootstrap front-end framework into my project from source? Is there a package manager for front-end libraries and frameworks? I'm using Grunt to compile my LESS. Here are the dependencies which you have to add to your package

Bower multiple registry URLs in .bowerrc

主宰稳场 提交于 2019-12-05 05:14:34
问题 I am looking to define more than one URL in my Bower settings to support the use of a private internal registry as well as the default Heroku registry. I have tried multiple settings that I have come across, but can't seem to get it working. There is nothing in the specs that say this is possible, but there is evidence others have gotten this to work. Can anyone point me in the right direction here? Is this possible, and if so, how is it done? 回答1: Someone at work helped me with this issue.

How can I install the grunt-cli without getting errors?

瘦欲@ 提交于 2019-12-05 05:11:44
Inspired by Chris Coyier's post , I decided I'd give grunt a go. But I'm having big problems getting set up. First, I installed Node. Then I added a package.json file to my project root, including this: { "name": "example-project", "version": "0.1.0", "devDependencies": { "grunt": "~0.4.1" } } Then I ran npm install Finally, I ran npm install -g grunt-cli which came back with a ton of errors: npm http GET https://registry.npmjs.org/grunt-cli npm http 304 https://registry.npmjs.org/grunt-cli npm ERR! Error: EACCES, mkdir '/usr/local/lib/node_modules/grunt-cli' npm ERR! { [Error: EACCES, mkdir '

Execute shell script in gruntfile and assign result to variable

梦想的初衷 提交于 2019-12-05 04:26:29
I am using grunt to manage a suite of mocha-run tests. One of the things required in the mocha test suite is that certain environment variables be set so that the tests are executed properly based on the environment of the developer running the tests. One of these environment variables will have a different value on every developer's machine, so we execute a bash script to return that value for the environment variable we are setting. I am using grunt.util.spawn to run the script and assign its result to a variable defined in my gruntfile, and then grunt-env to set the environment variable

gruntjs: use files with dynamic mapping in multitask config once for all targets

好久不见. 提交于 2019-12-05 02:23:26
问题 in my multi task I want to use dynamic mappings for files config property files: [ { expand: true, // Enable dynamic expansion. cwd: 'lib/', // Src matches are relative to this path. src: ['**/*.js'], // Actual pattern(s) to match. dest: 'build/', // Destination path prefix. }, ] is it possible to specify the "files" property once for all targets (and they would be expanded) to avoid redundancy? all targets are working with the same file structure, with the same files something like: taskName

Grunt & requirejs optimizer for a multi app project

落花浮王杯 提交于 2019-12-05 02:16:46
I'm having issues getting Grunt to perform requirejs optimization on a project with the following structure: static/js |── apps |── app.js |── dash.js |── news.js ... (many more 'app' files) |── build |── collections |── libs |── models |── util |── views Each of static/js/apps/*.js should be compiled to static/js/build/*.js containing the relevant dependencies (eg. views/view1 , libs/query etc). This is currently being performed by a basic bash script: JS_ROOT="static/js" for f in ${JS_ROOT}/apps/* do FILE=$(basename -s .js ${f}) pushd . cd ${JS_ROOT} && r.js -o baseUrl=. name=libs/require

Integrating the MobileServiceClient with AngularJS

被刻印的时光 ゝ 提交于 2019-12-05 02:02:26
问题 I'm trying to use the WindowsAzure.MobileServiceClient within Angular to do single sign on and CRUD operations. Being an Angular noob, I'm trying to figure out the best way to do this: Instantiate it in the $rootScope in .run and call the functions from there? Create a service or factory and make the instantiation of the MobileServiceClient and all of the function calls in that? Would the currentUser and other information get lost when the service/factory isn't being used? Just spool up

Can the gruntjs watch be restarted on grunt.js file change

◇◆丶佛笑我妖孽 提交于 2019-12-05 01:42:19
Can the grunt watch be restarted when ever there is a change in grunt.js file use case: I am right now in the process of building my grunt process and keep changing the grunt.js file and I have to restart the grunt.js to see if it works. jakerella It looks like this was implemented in version 0.4.0 . You can see the issue here which explains that by simply watching the Gruntfile (even without any tasks) the entire contents of the Grunt setup will be reloaded: watch: { grunt: { files: ['grunt.js'] } } Yes you can achieve it. For example add Gruntfile.js to your files array. watch: { js:{ files: