I know that is not standard but is possible to configure it's scope? Maybe only private ones? thanks
Asked
Active
Viewed 71 times
1 Answers
1
I recommend checking out this detailed article and discussion: How Do You Structure JavaScript? The Module Pattern Edition. As pointed out in the article comments, this is not actually the module pattern.
Here are some other resources on the module pattern
As to your specific question, it doesn't appear possible based on some discussion I came across on gruntjs's GitHub.
The original jshint task would still be callable without the build task run before it. I see only two ways to make this work:
- introduce a method of modifying tasks to add dependencies that need to run before them
- I've seen discussions about making tasks private. If this change is introduced, your way of defining a new task which runs the dependencies and the the actual (private) task would work too.
via https://github.com/gruntjs/grunt/issues/978#issuecomment-29388092
-
I agree and many folks discuss that problem in the comments of that article. For example, [this comment explains the problem and using modules instead](http://css-tricks.com/how-do-you-structure-javascript-the-module-pattern-edition/#comment-256070). – JSuar Jan 10 '14 at 02:14
-
I personally use: var Car = function(){}; _.(Car.prototype, {__run: function(){}}); For me this is the best. Anyway I would need to grunt to understand that __run's scope is only of this class – Totty.js Jan 10 '14 at 02:31