Skip to content
This repository has been archived by the owner on Sep 15, 2023. It is now read-only.

As a project dependency too #63

Closed
jlgrall opened this issue Dec 11, 2014 · 1 comment
Closed

As a project dependency too #63

jlgrall opened this issue Dec 11, 2014 · 1 comment

Comments

@jlgrall
Copy link

jlgrall commented Dec 11, 2014

Just an idea I had. Instead of starting from your project, I would start by making a new project, then I would run npm install gulp-starter. This will install it in my node_modules. And now I could simply use the gulp task from your gulp-starter in node_modules in my gulpfile.js.

My gulpfile.js could look like this:

// Get the default config and tweak it with my own options
// This way, I only need to define a few options
var config = extendDeep(require('node_modules/gulp-starter/gulp/config'), {
  browserSync.port: 8081,
  images.dest: "img",
  globals: {
    debug: false,
  }
});

// Set up "default", "build" and "clean" tasks:
require('node_modules/gulp-starter/gulp/tasks/base');

// Now only load the tasks we need
require('node_modules/gulp-starter/gulp/tasks/watch');
require('node_modules/gulp-starter/gulp/tasks/jshint-early');
require('node_modules/gulp-starter/gulp/tasks/browserify');
require('node_modules/gulp-starter/gulp/tasks/jshint-full');
require('node_modules/gulp-starter/gulp/tasks/browserSync');
require('node_modules/gulp-starter/gulp/tasks/sass');
//require('node_modules/gulp-starter/gulp/tasks/images');  // <- Temporarily disabled

A few benefits:

  • updates to gulp-starter can be applied easily by updating the module
  • no need to update my own code
  • I get all the best gulp tasks from the community
  • I can simply enable or disable a task. Tasks define themselves their own dependencies

It could use something like this: https://github.com/3rd-Eden/canihaz or like that https://github.com/unfold/gulpfile-install or https://www.npmjs.com/package/install-requires to prevent having a lot of unused dependencies (nobody uses sass, less and stylus at the same time).

@greypants
Copy link
Contributor

Interesting idea! Probably not something I'm going to undertake in the near future, but good to think about. Let me know if you end up putting something together. Another route some people have looked at is using Yeoman: https://github.com/yeoman/generator-gulp-webapp

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants