Define in the files element the files to copy to the package. If you want to test the nuspec file, just type the following command in the command line (where mypackage.nuspec is the name of the nuspec file).
nuget pack mypackage.nuspec
In order to create the file, go to the grunt script and add the following task (just rename the definition file name):
grunt.registerTask("nuget", "Create a nuget package", function () {
var done = this.async();
//invoke nuget.exe
grunt.util.spawn(
{
cmd: "nuget.exe",
args: [
//definition file
"pack",
"metro-bootstrap.nuspec",
//path where the package should be created
"-OutputDirectory",
"nuget",
//override the version using the version in package.json
"-Version",
grunt.config.get("pkg").version,
],
},
function (error, result) {
if (error) {
grunt.log.error(error);
} else {
grunt.log.write(result);
}
done();
}
);
});
Now, just open the command line and run the "grunt nuget" command, and a nuget package will be created.
The configuration used in this post is running on metro-bootstrap library. Fill free to fork it and try.
I hope this helps you.