I\'m trying out the new ASP.NET 5 with MVC 6, and I\'m using bower to manage all my client-side dependencies. Everything is working fine.
But I have a question: Whe
I have recently been playing in this space and following is something that I have tried:
.bowerrrc
file to enable installing in the default bower_components
folder under the project folder rather than under wwwroor\lib
as anything under wwwroot
tends to get published."main-bower-files": "2.9.0"
to package.json
. This package gets all the files mentioned in the main
property of each installed package's bower.json
files.Created a gulp task using the above package
gulp.task('copyMainFiles', function () {
return gulp.src(mainBowerFiles(), { base: 'bower_components' })
.pipe(gulp.dest('wwwroot/lib'));
});
Added a postrestore
step to your application's project.json
file
"scripts": {
"postrestore": "gulp copyMainFiles",
"prepublish": [ "npm install", "bower install", "gulp clean", "gulp min" ]
}
Updated my application's bower.json
to copy files which are not listed in main
(like some packages do not have min files as main files..ex: jQuery). The following settings are read by main-bower-files
:
"overrides": {
"jquery": {
"main": [ "dist/jquery.js", "dist/jquery.min.js" ]
},
"hammer.js": {
"main": [ "hammer.js", "hammer.min.js" ]
},
"bootstrap": {
"main": [
"./dist/js/bootstrap.js",
"./dist/js/bootstrap.min.js",
"./dist/css/bootstrap.css",
"./dist/css/bootstrap.min.css"
]
}
}
jquery-validation
package to use 1.14.0
instead of 1.11.1
as the previous version does not dist
folder and indeed no bower.json...