Closed amiceli closed 10 years ago
@amiceli works as expected in local test. Creates empty config in fresh project with no bower components installed. Can you give some more infos about your environment (OS, Node version, Gruntfile.js, package.json) (maybe as gist)
I'm on windows 7 64 bits. node v0.10.25 npm v1.4.3 grunt-cli v0.1.13 grunt v0.4.4
This is my Gruntfile
module.exports = function(grunt) {
grunt.initConfig({
bower: {
target: {
rjsConfig: 'config.js',
options: {
baseUrl: './'
}
}
}
});
grunt.loadNpmTasks('grunt-bower-requirejs');
grunt.registerTask('default', [ 'bower:target'])
}
When i run grunt bower:target --config my bower components are correctly installed but the config.js file is empty.
I need to check this on windows 7 later this day
Hi @amiceli,
even on windows 7 my tests run as expected. No issues though. But i'm a bit confused that your bower components get installed when running grunt bower:target
. This module does not install bower components. Sure you've got the right package installed?
I maybe found the problem, i've installed your module and grunt-bower-task module. This module install bower packages smartly.
In fact i want to generate requireJS config file with packages installed from grunt-bower-task
There are naming conflicts with those two module because they both register the bower
grunt task.
Try using this task instead of grunt-bower-task.
You should uninstall grunt-bower-task to prevent conflicts: npm uninstall --save-dev grunt-bower-task
grunt.registerTask('bower-install', function () {
var done = this.async();
grunt.util.spawn({
cmd: 'bower',
args: ['install'],
opts: {
stdio: 'inherit'
}
}, function (error, result) {
if (error) {
grunt.fail.fatal(result.stdout);
}
grunt.log.writeln(result.stdout);
done();
});
});
Thanks you, it works perfectly !
Just a question, there is a solution for use both modules ?
i think not. @robdodson @sindresorhus do you know something about a workaround to use both modules together?
Not off the top of my head. For the past few months I've thought it might be a good idea to change the grunt task name to bowerRjs
or something like that since stealing the bower
name is kind of greedy on our part.
When I run this command, the configuration file is not created :
My Grunt file :
thanks for your help.