Giter VIP home page Giter VIP logo

gulp-grunt's People

Contributors

asgoth avatar bakharal avatar bdwain avatar chrisxue815 avatar davidtheclark avatar jorrit avatar maxov avatar ocombe avatar olivierphi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

gulp-grunt's Issues

force = true?

Hi, just wondering why you're setting force to true for all tasks. Is this necessary? It seems like it has the potential to be dangerous and I wonder if there was a reason to do that rather than parameterize it.

Unable to run

Why its given gruntCliDir + to spawn at
spawn( gruntCliDir + gruntCmd, args, {cwd: cwd} );

On providing a base its trying to execute /grunt which gives error , on removing gruntCliDir + its working fine

bad option: --force

I have some issues after installing macOS Mojave.

Can't use gulp-grunt with node 11.1.0:

/usr/local/Cellar/node/11.1.0/bin/node: bad option: --force
/usr/local/Cellar/node/11.1.0/bin/node: bad option: --force=true

Even grunt-cli installing doesn't help ( https://stackoverflow.com/questions/52150323/grunt-force-fails-with-node-bad-option?rq=1 )

When I pass param:
require('gulp-grunt')(gulp, {
force: false
});
I still get:
/usr/local/Cellar/node/11.1.0/bin/node: bad option: --force=false

throw event error

It's my gulp config:

var gulp = require('gulp');
require('gulp-grunt')(gulp,{
    base: './',
    prefix: 'grunt-',
    verbose: false
});
gulp.task('tpl', function() {
    return gulp.start('grunt-tpl');
});

when i execute gulp tpl,my console throw event error:

$ gulp tpl
[18:36:26] Using gulpfile f:\A_local\vipMobile\gulpfile.js
[18:36:26] Starting 'tpl'...
[18:36:26] Starting 'grunt-tpl'...
[18:36:26] Finished 'tpl' after 4.99 ms
events.js:141
      throw er; // Unhandled 'error' event
      ^

Error: spawn .//grunt.cmd ENOENT
    at exports._errnoException (util.js:874:11)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:178:32)
    at onErrorNT (internal/child_process.js:344:16)
    at doNTCallback2 (node.js:439:9)
    at process._tickCallback (node.js:353:17)
    at Function.Module.runMain (module.js:469:11)
    at startup (node.js:134:18)
    at node.js:961:3

But,grunt tpl run well.

Specify dependencies for grunt tasks

I have a use case where-by when parsing the grunt file and creating gulp tasks, I need to be able to specify a dependency for the for the gulp task that gets created. For example, given the following gulp task:

gulp.task('create-some-files', function() {
  var stream = //create some files in a specific location
  return stream;
});

I have a gruntfile somewhere that uses the files that are created in the gulp task:

grunt.initConfig({
     useSomeFiles: {
        src: '/path/to/files/created/in/gulp/task'
     }
});

It would be ideal if when loading gulp-grunt, I could specify a dependency for the grunt task. Maybe something like:

require('gulp-grunt')(gulp, { 
    deps: { 
        useSomeFiles: 'create-some-files' 
    }
});

which would result in a gulp task being created with the signature:

gulp.task('grunt-useSomeFiles',['create-some-files'], fn);

I realize there are lots of questions to answer before a workable solution could be implemented. For example, the grunt tasks can have multiple targets, how would you specify dependencies per target, etc.

If it could be figured out, it would be a nice feature to have.

Pass gulp flags to grunt task

Haw can i use gulp flags like (--release and etc) in grunt task? Is there any possibilities to pass gulp flag (via gutil.env.flagName) to grunt?

`gulp-grunt` depends on a globally installed `grunt-cli`.

Hi!

Here are some extracts from my gulpfile.coffee and package.json:

gulp.task "svg2string", ->
  gulp.start "grunt-svg2string"
    "grunt-svg2string": "^0.1.6",
    "gulp-grunt": "^0.5.2",

When i ran gulp svg2string, i received this cryptic error:

$ gulp svg2string
[16:57:15] Requiring external module coffee-script/register
[16:57:18] Using gulpfile ~/Code/hb_frontend_angular/gulpfile.coffee
[16:57:18] Starting 'svg2string'...
[16:57:18] Starting 'grunt-svg2string'...
[16:57:18] Finished 'svg2string' after 5.56 ms

events.js:72
        throw er; // Unhandled 'error' event
              ^
Error: spawn ENOENT
  at errnoException (child_process.js:1011:11)
  at Process.ChildProcess._handle.onexit (child_process.js:802:34)

Lack of any indication of the reason left us clueless with the cause of the problem and possible solutions. There wasn't even an error message to google for.

While debugging this issue we decided to try running grunt svg2string. To be able to do that, i had to install Grunt CLI: npm install -g grunt-cli. After that, the command gulp svg2string started working fine without issue!

Thus we discovered by luck that gulp-grunt depends on a globally installed grunt-cli.

This should not be so. I expect my Gulp recipes to work after doing

npm install -g gulp
npm install
gulp some-grunt-task

gulp-grunt changes cwd

gulp-grunt changes the process cwd. Using gulp-grunt as per the README:

require('gulp-grunt')(gulp, {
  base: __dirname + '/foo'
});

leads to process.cwd() being changed to __dirname/foo. This causes relative gulp.src paths to silently fail.

Following docs results in deprecation notice for gulp.run()

This is a great plugin, so thanks for creating it! I had no trouble getting set up using your current docs, and everything seems to work just fine. However, I noticed this in my console:

gulp.run() has been deprecated. Use task dependencies or gulp.watch task triggering instead.

Is there an alternative way of running these tasks? I found this SO page recommending the use of gulp.watch instead, along with another answer that incorrectly recommended gulp.start which is disappearing soon.

I'd mostly like to figure out the "right way" and I'd be happy to PR the docs back in order once I understand the best way to set the plugin up.

Use specific targets rather than the full task

It doesn't look to me like there's a way to use a specific Grunt target rather than the full task -- the equivalent of running grunt assemble:dev rather than just grunt assemble (which runs all the assemble targets).

I would like to be able to do this. What do you think?

At first I was having a hard time finding a way via the Grunt API to get what would be needed -- but then I found that the grunt.config.get() method could be used to get the configuration object, whose keys would be target names. So that's one way, unless you know of something better.

Extra console.log

Are you able to remove the console.log on line 66, or at least change it to something more descriptive.

Configurations not loaded

Hello!
Looks like gulp-grunt plugin does not load configuration, and it may then be unable to run some kind of tasks.

A simple test case can be found here
gulp-grunt stops while loading claiming cannot find srcModules submodule.

V.

Spawn errors ENOENT when using options.base to specify custom Gruntfile.js location

Hi there,

As a few have pointed out already, in your documentation it says that setting options.base will be used for specifying a custom Gruntfile.js location. However, in the code it is being used as the path to the grunt executable. This is causing ENOENT errors because it is trying to spawn from an invalid location. (Since the grunt executable would not likely exist in the same directory as the Gruntfile, its either globally installed /usr/bin (etc) and on the PATH, or when grunt-cli is a dependency it would be in node_modules/.bin)

A solution would be to have two separate options for the Gruntfile location and the grunt executable

As a side note, the mocha tests are not picking this error up because it seems that the overriding of process.stdout.write is having the side effect of squelching the failing tests.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.