user4744080
user4744080

Reputation:

Bower: run build system

Is it possible run "grunt" or "gulp" automatically during installation with bower?

to generate the compiled version of the package without including a compiled version in the git repository.

For example:

I install a github package called: foo/bar, I use: bower install foo/bar

I get the source code that has a Gruntfile.json file that compiles the source code in a single file called main.js. How do I get bower run "npm install && grunt" automatically

Upvotes: 1

Views: 685

Answers (1)

Nick Tomlin
Nick Tomlin

Reputation: 29261

It would help if you could give a clearer use case, but you can use bower's install hooks to run an arbitrary command on install.

// .bowerrc
{
    "scripts": {
        "postinstall": "gulp build",
    }
}

preinstall, postinstall, and preuninstall are supported.

Upvotes: 2

Related Questions