FAQ Database Discussion Community


GruntJS and custom task: require a RequireJS module

gruntjs,requirejs,grunt-contrib-requirejs
I am quite new with GruntJS and I wonder if it is possible to have a task that loads some RequireJs modules to process them and write the result within a JS file. I describe my scenario: I have a RequireJs based project with many files. I would like to...

Images doesn't display on AngularJS website after uploading them with filezilla

angularjs,image,website,gruntjs,filezilla
I created an AngularJS project. With doing the grunt serve, grunt serve:dist commands in my terminal, my images are loaded. I upload my page to a webserver with filezilla, but on the public webpage my images are not found. I discovered that the images in my dist folder 2 extensions...

Organize multi-app project with share code

git,github,gruntjs,openui5,sapui
I have a serious problem (!!!) about organizing my develop environment; I have two apps: app1 and app2. This apps are written using OpenUI5 (but this detail is not important) app1 and app2 are similar and share some code (for example the code to login). I use git (with git-flow)...

How to setup grunt-babel to transpile an entire directory

gruntjs,babel,transpiler
So I have this in my gruntfile: gruntConfig.babel = { options: { sourceMap: true }, dist: { files: { "dist/server.js": "src/*.js" } } }; This correctly transpiles all the js files in src, but it overwrites dist/server.js every time. This must be really simple, but I can't seem to figure...

execute a node command from a grunt task

node.js,gruntjs
I have a grunt task from which I would like to run a node command. The command is not giving any error when I run it, but I was expecting some console output from the task, which I don't seem to be getting at all. What am I missing in...

What is the correct option to use Grunt locally and on the production server, --save or --save-dev?

gruntjs
The install page on the Grunt website gives the following suggestion Grunt and Grunt plugins should be defined as devDependencies in your project's package.json. This will allow you to install all of your project's dependencies with a single command: npm install. I want to use grunt to run some tasks...

How can I minify my index.php using grunt?

php,html,optimization,gruntjs,minify
I want to achieve this using grunt Goal My main goal is to minify my index.php before placing them on my production server. It's simple if I have 1 single index.html, but I don't. Instead I have an index.php full with other .php files. Each <?php ?> section is...

Yeoman - Gruntfile.js generates source map at build but deletes it after any changes

sass,gruntjs,yeoman,yeoman-generator,gruntfile
I installed Yeoman with angular generator, and it created Gruntfile.js. The problem is that after launching the webserver in the terminal with: grunt serve Yeoman generates main.css with in the end the reference of the source map /*# sourceMappingURL=main.css.map */ But after changing any scss the watch routine regenerates it...

apt-get install -g grunt grunt-cli missing modules

node.js,gruntjs
I'm using a Ubuntu 14.04 server and am trying to install grunt & grunt-cli with this command: npm install -g grunt grunt-cli Everything looks fine, no errors are recieved. But when I run the standard grunt command, I recieve this error: module.js:338 throw err; ^ Error: Cannot find module 'eventemitter2'...

Grunt tasks stuck in endless loop

javascript,node.js,gruntjs,npm,grunt-contrib-concat
Working on putting together a base Gruntfile.js for some upcoming projects. Starting in on a new computer so everything has been a fresh build. Installed Node and NPM using Homebrew, and then installed Grunt globally, as well as in my local directory. Here is my package.json: { "name": "timespent-prototype", "version":...

Can I use grunt/gulp to pull a specific version of bootstrap css

twitter-bootstrap,gruntjs,gulp
I'm working on a build process that will compile bootstrap css with my overrides. I would like to specify a version of bootstrap in my config and have grunt/gulp go and get the .less files for that version and then compile them. Is there any plugin or process to have...

generating templates with grunt - looking for a task

javascript,node.js,templates,gruntjs,task
I've got an HTML file with following content: <html> <body> <span>{{ secret }}</span> </body> </html> I'm looking for a grunt task that could take this source file, take a map of values: grunt.initConfig({ myTask: { myTarget: { src: ... dest: ... values: { secret: 'ABC' } } } }) and...

Why doesn't postinstall run everytime?

jenkins,gruntjs,npm
I have a package.json file that has the following JSON at the bottom. "scripts": { "postinstall": [ "./node_modules/bower/bin/bower install && ./node_modules/protractor/bin/webdriver-manager update" ] } My reason for having this is so bower dependencies and my protractor tests will run after an "npm install". However, it seems that "postinstall" doesn't always...

Grunt inject CSS file into