【发布时间】:2015-03-03 18:57:03
【问题描述】:
问题
我已将 bootswatch slate 主题安装到我的 bower.json 中。我这样做如下:
bower install bootswatch-dist#slategrunt
不幸的是,当我的 Grunftile 被调用时,它不会使用 bootswatch 更新我的 wwwroot 组件。我究竟做错了什么?
bower.json
{
"name": "SampleLibrary",
"version": "0.0.0",
"license": "MIT",
"private": true,
"dependencies": {
"jquery-validation": "~1.13.1",
"jquery-validation-unobtrusive": "~3.2.2",
"bootstrap": "~3.3.2",
"jquery-ui": "~1.11.3",
"bootswatch-dist": "slate"
}
}
Gruntfile.js
module.exports = function (grunt) {
grunt.initConfig({
bower: {
install: {
options: {
targetDir: "wwwroot/lib",
layout: "byComponent",
cleanTargetDir: false,
}
}
}
});
//This command registers the default task which will install bower packages into wwwroot/lib
grunt.registerTask("default", ["bower:install"]);
//This command loads the grunt plugins
grunt.loadNpmTasks("grunt-bower-task");
};
尝试
我按照这些资源给出的指示进行操作:
- Similar problem to mine, but no solution given?
- Gruntfile documentation我有 grunt-bower-task。还是坏了。
- 运行
bower info bootswatch-dist以确认#slate 确实存在。这是。
真正令人沮丧的是,在 bower.json 文件中列为依赖项的所有其他内容都转到 wwwroot,但 bootswatch 除外。我能够使用 bower install 将 bootswatch 放入 bower 文件,但是我的 Gruntfile.js 忽略了它?
我真的很困惑。请帮忙。 ASP.NET5 和 MVC6 有很大的前景,但是试图弄清楚如何引入新的依赖项比我最初想象的要棘手。
【问题讨论】:
标签: json gruntjs bower asp.net-core visual-studio-2015