Skip to content

gulpfile.js in File-New Project template needs to be improved #628

@dpaquette

Description

@dpaquette

A few things specifically that should be changed.

  1. The Copy task needs to return a stream. Currently it returns nothing which is bad practice and would make it impossible to extend the gulpfile. For example, I would not be able to create a task that runs in sequence after the Copy task. Consider doing something along the lines of the running-task-steps-per-folder recipe (https://github.com/gulpjs/gulp/blob/master/docs/recipes/running-task-steps-per-folder.md).

  2. Is this eval("var project = " + fs.readFileSync("./project.json")); required? When I write it as var project = fs.readFileSync("./project.json"); it still seems to work.

Overall though, I think the file could be improved. When I talk to people in the community about using bower and tasks runners in ASP.NET, one of the big complaints is about all the manual wiring that is needed. It would be really nice if we could design a default gulpfile.js file such that after installing a new bower package, the required files would be automatically copied to the wwwroot/lib folder. If we could do that, we would solve 90% of the problems people are having with this new approach. I know that it won't work in every situation, but we should be able to design something that works most of the time.

Some variation of what is presented in this blog should work (http://blog.simontimms.com/2015/01/22/getting-bower-components-in-gulp/).

I would be happy to help with this but I don't think the project templates are in a public repo. Is there any way for us to contribute to the project templates?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions