gruntjs / grunt-contrib-connect

Start a static web server.
http://gruntjs.com
MIT License
714 stars 146 forks source link

define module entry point in package.json #159

Closed bastien03 closed 9 years ago

bastien03 commented 9 years ago

Problem

We are writing a Grunt plugin using grunt-contrib-connect (and other plugins) in order to preconfigure them. We load the different modules using the node require method. Because the entry point of grunt-contrib-connect is not defined, we have to load it this way: require(require-contrib-connect/tasks/connect.js). We have to know the structure of the module in order to load it.

Solution

The solution is to define the module entry point in the package.json: "main": "tasks/connect.js" Then we can load module in a better way: require('grunt-contrib-connect').

shama commented 9 years ago

@vladikoff I'm cool with this. Previously I've been wary about officially supporting this because tasks don't have a good way to inherit each other but not doing so also doesn't prevent it. So :+1:

vladikoff commented 9 years ago

@shama thanks!

bastien03 commented 9 years ago

thanks for the quick merge!