Use grunt-bower-task in MusicStore.Spa

This commit is contained in:
DamianEdwards 2014-10-06 14:30:08 -07:00
parent 7055949e7b
commit 18bd42bcfe
8 changed files with 59 additions and 65 deletions

View File

@ -1,5 +1,11 @@
@import '../bower_components/bootstrap/less/bootstrap.less';
@font-face {
font-family: 'Glyphicons Halflings';
src: url('../lib/bootstrap/fonts/glyphicons-halflings-regular.eot');
src: url('../lib/bootstrap/fonts/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'), url('../lib/bootstrap/fonts/glyphicons-halflings-regular.woff') format('woff'), url('../lib/bootstrap/fonts/glyphicons-halflings-regular.ttf') format('truetype'), url('../lib/bootstrap/fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular') format('svg');
}
[ng\:cloak], [ng-cloak], [data-ng-cloak], [x-ng-cloak], .ng-cloak, .x-ng-cloak {
display: none !important;
}

View File

@ -3,12 +3,23 @@
module.exports = function (grunt) {
grunt.loadNpmTasks("grunt-bower-task");
grunt.initConfig({
staticFilePattern: "**/*.{js,css,map,html,htm,ico,jpg,jpeg,png,gif,eot,svg,ttf,woff}"
staticFilePattern: "**/*.{js,css,map,html,htm,ico,jpg,jpeg,png,gif,eot,svg,ttf,woff}",
bower: {
install: {
options: {
targetDir: "wwwroot/lib",
layout: "byComponent",
cleanTargetDir: true
}
}
}
});
grunt.registerTask("ts", ["tslint", "tsng", "typescript:dev", "clean:tsng"]);
grunt.registerTask("dev", ["clean", "copy", "less:dev", "ts"]);
grunt.registerTask("dev", ["clean:assets", "copy", "bower:install", "less:dev", "ts"]);
grunt.registerTask("release", ["clean", "copy", "uglify", "less:release", "typescript:release"]);
grunt.registerTask("default", ["dev"]);

View File

@ -15,10 +15,10 @@
@section Scripts {
<script src="~/js/angular.js"></script>
<script src="~/js/angular-route.js"></script>
<script src="~/js/ui-bootstrap.js"></script>
<script src="~/js/ui-bootstrap-tpls.js"></script>
<script src="~/lib/angular/angular.js"></script>
<script src="~/lib/angular-route/angular-route.js"></script>
<script src="~/lib/angular-bootstrap/ui-bootstrap.js"></script>
<script src="~/lib/angular-bootstrap/ui-bootstrap-tpls.js"></script>
@* TODO: This is currently all the compiled TypeScript, non-minified. Need to explore options
for alternate loading schemes, e.g. AMD loader of individual modules, min vs. non-min, etc. *@
<script src="~/js/@(ViewBag.ngApp).js"></script>

View File

@ -17,8 +17,8 @@
@section Scripts {
<script src="~/js/angular.js"></script>
<script src="~/js/angular-route.js"></script>
<script src="~/lib/angular/angular.js"></script>
<script src="~/lig/angular-route/angular-route.js"></script>
@* TODO: This is currently all the compiled TypeScript, non-minified. Need to explore options
for alternate loading schemes, e.g. AMD loader of individual modules, min vs. non-min, etc. *@
<script src="~/js/@(ViewBag.ngApp).js"></script>

View File

@ -5,8 +5,8 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>@ViewBag.Title MVC Music Store</title>
<link rel="stylesheet" href="~/css/site.css" />
<script src="~/js/respond.src.js"></script>
<script src="~/js/modernizr.js"></script>
<script src="~/lib/respond/respond.src.js"></script>
<script src="~/lib/modernizr/modernizr.js"></script>
</head>
<body>
<nav class="navbar navbar-inverse navbar-fixed-top">
@ -42,9 +42,9 @@
@* TODO: Need to figure out best way to switch these to min links for release, e.g. new helper,
Grunt task to replace, CDN support, etc. *@
<script src="~/js/jquery.js"></script>
@*<script src="~/js/jquery.validate.js"></script>*@
<script src="~/js/bootstrap.js"></script>
<script src="~/lib/jquery/jquery.js"></script>
@*<script src="~/lib/jquery.validation/jquery.validate.js"></script>*@
<script src="~/lib/bootstrap/js/bootstrap.js"></script>
@RenderSection("scripts", required: false)
</body>

View File

@ -4,14 +4,37 @@
"private": true,
"dependencies": {
"bootstrap": "~3.1.0",
"jquery.validation": "~1.11.1",
"jquery.validation": "~1.13.0",
"jquery": "~2.1.0",
"modernizr": "~2.7.1",
"respond": "~1.4.2",
"dt-angular": "~1.2.15",
"angular": "~1.2.15",
"angular-route": "~1.2.15",
"angular-bootstrap": "~0.10.0",
"dt-angular-ui-bootstrap": "*"
}
"angular-bootstrap": "~0.10.0"
},
"devDependencies": {
"dt-angular": "~1.2.15",
"dt-angular-ui-bootstrap": "*",
"dt-jquery": "~2.0.0"
},
"exportsOverride": {
"bootstrap": {
"js": "dist/**/*.js",
"css": "dist/**/*.css",
"fonts": "**/*.{eot,svg,ttf,woff}"
},
"jquery": {
"": "dist/*.{js,map}"
},
"/angular/": {
"": "*.{js,map}"
},
"modernizr": {
"": "modernizr.js"
},
"respond": {
"": "dest/*.{js,map}"
},
"dt-*": { }
}
}

View File

@ -1,6 +1,5 @@
{
"options": { "force": true },
"bower": [ "wwwroot/*", "!wwwroot/bin" ],
"assets": [ "wwwroot/*", "!wwwroot/bin" ],
"assets": [ "wwwroot/*", "!wwwroot/bin", "!wwwroot/lib" ],
"tsng": [ "client/**/*.ng.ts" ]
}

View File

@ -5,51 +5,6 @@
"bower_components/jquery/jquery.d.ts": [ "bower_components/dt-jquery/jquery.d.ts" ]
}
},
"bower": {
"files": [
{
"_": "JavaScript",
"expand": true,
"flatten": true,
"cwd": "bower_components/",
"src": [
"modernizr/modernizr.js",
"jquery/dist/*.{js,map}",
"jquery.validation/jquery.validate.js",
"jquery.validation/additional-methods.js",
"bootstrap/dist/**/*.js",
"respond/dest/**/*.js",
"angular/*.{js,.js.map}",
"angular-route/*.{js,.js.map}",
"angular-bootstrap/ui-bootstrap*"
],
"dest": "wwwroot/js/",
"options": { "force": true }
},
{
"_": "CSS",
"expand": true,
"flatten": true,
"cwd": "bower_components/",
"src": [
"bootstrap/dist/**/*.css"
],
"dest": "wwwroot/css/",
"options": { "force": true }
},
{
"_": "Fonts",
"expand": true,
"flatten": true,
"cwd": "bower_components/",
"src": [
"bootstrap/**/*.{woff,svg,eot,ttf}"
],
"dest": "wwwroot/fonts/",
"options": { "force": true }
}
]
},
"assets": {
"files": [
{