我正在构建一个使用grunt-foo
的模块grunt-galvanize
(例如,我的package.json
中的模块作为依赖项)。像这样:
module.exports = function(grunt) {
require('load-grunt-tasks')(grunt)
grunt.registerMultiTask('foo', 'do your foo', function() {
grunt.task.run('bar');
});
grunt.registerTask('bar', function() {
// Add some galvanize configs
grunt.option('galvanizeConfig', { configs: { ... } });
grunt.task.run(['galvanize:baz'])
});
grunt.registerTask('baz', function() { grunt.log.ok('baz'); });
};
但是,当我在应用中使用此grunt模块并运行grunt foo
时,我会得到类似Warning: Task "galvanize:baz" not found. Use --force to continue.
我正在寻找一种解决方案,不需要在使用我的grunt模块的应用程序中安装grunt-galvanize
作为依赖项(dev或其他)。