问题描述
因此,我正在玩MVC6,并添加了bower.json&grunt.json,我创建了grunt任务来生成jQuery&bootstrap.css及其所有文件都位于我期望的wwwroot文件夹中.
So I'm playing around with MVC6, and I've added bower.json & grunt.json, I've created my grunt tasks for generating my jQuery & bootstrap.css and its all sitting in the wwwroot folder as i expected.
但是关于我的site.css&我的main.js文件,随着时间的推移我将添加到项目中的文件.
But what about things like my site.css & my main.js files, the files that I will add to for the project over time.
人们为这些内容选择目录时会使用什么约定?
What convention are people using when choosing a directory for this stuff?
我们是否要添加内容文件夹并将其放入?
Are we to add a Content folder and drop it in?
我是否缺少某些东西,我也应该为此使用Grunt/bower?
Is there something I'm missing, that i should also be using Grunt / bower for?
推荐答案
我在wwwroot之外确实有应用程序和供应商文件夹.在供应商中,我自定义了引导程序,主题之类的库.在应用程序中,我有自己的css,less和js文件用于应用程序.我在应用程序中也有一个资产路径,可以复制任何需要复制的内容(屏幕快照中显示的文件夹字体)
I do have app and vendor folders outside wwwroot.In vendor, I customize libraries like bootstrap, themes.In app I have my own css, less and js files for the application.I also have an asset path inside app for anything that needs to be copied (folder font shown in the screenshot)
然后,我使用自以为是的方法,真的很容易使用,并且比咕unt声或古尔夫工具(早午餐)更好.
Then I use the opinionated really easy to use and way better than grunt or gulp tool: brunch.
通过这个简单的配置,我得到了sourcemaps,concat,jshint,并通过-production
也进行了uglify,minify和csso.向管道中添加其他任何内容就像安装早午餐插件一样简单,因此我建议您还检查 http://brunch.io/退出.
With this simple config, I get sourcemaps, concat, jshint, and with --production
also uglify, minify, csso.Adding anything else to the pipeline is simple as installing a brunch-plugin, so I recommend to also check http://brunch.io/ out.
这篇关于ASP.NET 5 MVC6自定义CSS和JavaScript放置约定的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!