大佬教程收集整理的这篇文章主要介绍了gruntjs – 使用Yeoman工作流程添加css文件的位置,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
<!-- build:css({.tmp,app}) styles/calendar.css --> <link rel="stylesheet" href="styles/fullcalendar.css" /> <!-- endbuild -->
然而,当我使用grunt(基本的yeoman grunt配置)构建时,似乎没有创建calendar.css文件.我怀疑这可能是因为main.html文件在view / main.html中.
从我的grunt文件:
usemin: { html: ['<%= yeoman.dist %>/{,*/}*.html'],css: ['<%= yeoman.dist %>/styles/{,*/}*.css'],options: { dirs: ['<%= yeoman.dist %>'] } },
…
cssmin: { // By default,your `index.html` <!-- Usemin Block --> will take care of // minification. This option is pre-configured if you do not wish to use // Usemin blocks. // dist: { // files: { // '<%= yeoman.dist %>/styles/main.css': [ // '.tmp/styles/{,*/}*.css',// '<%= yeoman.app %>/styles/{,*/}*.css' // ] // } // } },
它不会在views目录中.我怀疑我正在使用工作流程错误.
由于您使用自定义的工作流程,所以在Gruntfile.js中需要更多的配置. (如果您已经完成了这些操作,请忽略).
首先,复制任务需要更新,以将您的app / views目录复制到dist / views.这是一个很容易解决的问题:
copy: { dist: { files: [{ expand: true,dot: true,cwd: '<%= yeoman.app %>',dest: '<%= yeoman.dist %>',src: [ '*.{ico,png,txt}','.htaccess','images/{,*/}*.{webp,gif}','styles/fonts/*','views/*' ] }] },// ... }
酷酷现在,在您的东西被复制之前运行的useminPrepare也需要了解views目录.
useminPrepare: { options: { dest: '<%= yeoman.dist %>' },html: [ '<%= yeoman.app %>/index.html','<%= yeoman.app %>/views/*.html' ] },
哇哇!而已!
让我知道,如果你在任何地方卡住了!
以上是大佬教程为你收集整理的gruntjs – 使用Yeoman工作流程添加css文件的位置全部内容,希望文章能够帮你解决gruntjs – 使用Yeoman工作流程添加css文件的位置所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。