- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有一个使用usemin的grunt脚本,但奇怪的是index.html文件根本不受usemin影响!这意味着我的文件仍然包含所有
<!-- build:css styles/main.css -->
<link rel="stylesheet" href="styles/style.css">
<link rel="stylesheet" href="styles/bs-growl-notifications.css">
<!-- endbuild -->
日志中最奇怪的部分是这个(尽管它找到了 block ,但它什么也没做 - 请参阅完整日志):
Processing as HTML - dist/index.html
Update the HTML to reference our concat/min/revved script files
Update the HTML with the new css filenames
Update the HTML with the new img filenames
Update the HTML with data-main tags
Update the HTML with the data tags
Update the HTML with background imgs, case there is some inline style
Update the HTML with anchors images
Update the HTML with reference in input
这是完整的日志:
Running "clean:dist" (clean) task
Cleaning .tmp...OK
Cleaning dist/index.html...OK
Cleaning dist/scripts...OK
Cleaning dist/styles...OK
Running "replace:dist" (replace) task
Replace app/index.html -> .tmp/index.html
Running "useminPrepare:html" (useminPrepare) task
Going through .tmp/index.html to update the config
Looking for build script HTML comment blocks
Found a block:
<!-- build:css styles/main.css -->
<link rel="stylesheet" href="styles/style.css">
<link rel="stylesheet" href="styles/bs-growl-notifications.css">
<!-- endbuild -->
Updating config with the following assets:
- .tmp\styles\style.css
- .tmp\styles\bs-growl-notifications.css
Found a block:
<!-- build:js(app) scripts/components.js -->
<script src="bower_components/jquery/dist/jquery.js"></script>
<script src="bower_components/handlebars/handlebars.runtime.js"></script
>
<script src="bower_components/ember/ember.prod.js"></script>
<script src="bower_components/ember-data/ember-data.prod.js"></script>
<!-- endbuild -->
Updating config with the following assets:
- app\bower_components\jquery\dist\jquery.js
- app\bower_components\handlebars\handlebars.runtime.js
- app\bower_components\ember\ember.prod.js
- app\bower_components\ember-data\ember-data.prod.js
Found a block:
<!-- build:js(.tmp) scripts/templates.js -->
<script src="scripts/compiled-templates.js"></script>
<!-- endbuild -->
Updating config with the following assets:
- .tmp\scripts\compiled-templates.js
Found a block:
<!-- build:js(.tmp) scripts/main.js -->
<script src="scripts/combined-scripts.js"></script>
<!-- endbuild -->
Updating config with the following assets:
- .tmp\scripts\combined-scripts.js
Found a block:
<!-- build:js scripts/plugins.js -->
<script src="bower_components/ember-addons.bs_for_ember/dist/js/bs-core.
max.js"></script>
<script src="bower_components/ember-addons.bs_for_ember/dist/js/bs-alert
.max.js"></script>
<script src="bower_components/ember-addons.bs_for_ember/dist/js/bs-badge
.max.js"></script>
<script src="bower_components/ember-addons.bs_for_ember/dist/js/bs-basic
.max.js"></script>
<script src="bower_components/ember-addons.bs_for_ember/dist/js/bs-butto
n.max.js"></script>
<script src="bower_components/ember-addons.bs_for_ember/dist/js/bs-growl
-notifications.max.js"></script>
<script src="bower_components/ember-addons.bs_for_ember/dist/js/bs-items
-action-bar.max.js"></script>
<script src="bower_components/ember-addons.bs_for_ember/dist/js/bs-label
.max.js"></script>
<script src="bower_components/ember-addons.bs_for_ember/dist/js/bs-list-
group.max.js"></script>
<script src="bower_components/ember-addons.bs_for_ember/dist/js/bs-modal
.max.js"></script>
<script src="bower_components/ember-addons.bs_for_ember/dist/js/bs-nav.m
ax.js"></script>
<script src="bower_components/ember-addons.bs_for_ember/dist/js/bs-notif
ications.max.js"></script>
<script src="bower_components/ember-addons.bs_for_ember/dist/js/bs-progr
essbar.max.js"></script>
<script src="bower_components/ember-addons.bs_for_ember/dist/js/bs-wizar
d.max.js"></script>
<!-- endbuild -->
Updating config with the following assets:
- .tmp\bower_components\ember-addons.bs_for_ember\dist\js\bs-core.max.js
- .tmp\bower_components\ember-addons.bs_for_ember\dist\js\bs-alert.max.js
- .tmp\bower_components\ember-addons.bs_for_ember\dist\js\bs-badge.max.js
- .tmp\bower_components\ember-addons.bs_for_ember\dist\js\bs-basic.max.js
- .tmp\bower_components\ember-addons.bs_for_ember\dist\js\bs-button.max.js
- .tmp\bower_components\ember-addons.bs_for_ember\dist\js\bs-growl-notificat
ions.max.js
- .tmp\bower_components\ember-addons.bs_for_ember\dist\js\bs-items-action-ba
r.max.js
- .tmp\bower_components\ember-addons.bs_for_ember\dist\js\bs-label.max.js
- .tmp\bower_components\ember-addons.bs_for_ember\dist\js\bs-list-group.max.
js
- .tmp\bower_components\ember-addons.bs_for_ember\dist\js\bs-modal.max.js
- .tmp\bower_components\ember-addons.bs_for_ember\dist\js\bs-nav.max.js
- .tmp\bower_components\ember-addons.bs_for_ember\dist\js\bs-notifications.m
ax.js
- .tmp\bower_components\ember-addons.bs_for_ember\dist\js\bs-progressbar.max
.js
- .tmp\bower_components\ember-addons.bs_for_ember\dist\js\bs-wizard.max.js
Configuration is now:
cssmin:
{ dist:
{ files:
{ '<%= yeoman.dist %>/styles/main.css':
[ '.tmp/styles/{,*/}*.css',
'app/styles/{,*/}*.css' ] } },
'dist\\styles\\main.css': 'dist\\styles\\main.css' }
concat:
{ 'dist\\styles\\main.css':
[ '.tmp\\styles\\style.css',
'.tmp\\styles\\bs-growl-notifications.css' ],
'dist\\scripts\\components.js':
[ 'app\\bower_components\\jquery\\dist\\jquery.js',
'app\\bower_components\\handlebars\\handlebars.runtime.js',
'app\\bower_components\\ember\\ember.prod.js',
'app\\bower_components\\ember-data\\ember-data.prod.js' ],
'dist\\scripts\\templates.js': [ '.tmp\\scripts\\compiled-templates.js' ],
'dist\\scripts\\main.js': [ '.tmp\\scripts\\combined-scripts.js' ],
'dist\\scripts\\plugins.js':
[ '.tmp\\bower_components\\ember-addons.bs_for_ember\\dist\\js\\bs-core.max.j
s',
'.tmp\\bower_components\\ember-addons.bs_for_ember\\dist\\js\\bs-alert.max.
js',
'.tmp\\bower_components\\ember-addons.bs_for_ember\\dist\\js\\bs-badge.max.
js',
'.tmp\\bower_components\\ember-addons.bs_for_ember\\dist\\js\\bs-basic.max.
js',
'.tmp\\bower_components\\ember-addons.bs_for_ember\\dist\\js\\bs-button.max
.js',
'.tmp\\bower_components\\ember-addons.bs_for_ember\\dist\\js\\bs-growl-noti
fications.max.js',
'.tmp\\bower_components\\ember-addons.bs_for_ember\\dist\\js\\bs-items-acti
on-bar.max.js',
'.tmp\\bower_components\\ember-addons.bs_for_ember\\dist\\js\\bs-label.max.
js',
'.tmp\\bower_components\\ember-addons.bs_for_ember\\dist\\js\\bs-list-group
.max.js',
'.tmp\\bower_components\\ember-addons.bs_for_ember\\dist\\js\\bs-modal.max.
js',
'.tmp\\bower_components\\ember-addons.bs_for_ember\\dist\\js\\bs-nav.max.js
',
'.tmp\\bower_components\\ember-addons.bs_for_ember\\dist\\js\\bs-notificati
ons.max.js',
'.tmp\\bower_components\\ember-addons.bs_for_ember\\dist\\js\\bs-progressba
r.max.js',
'.tmp\\bower_components\\ember-addons.bs_for_ember\\dist\\js\\bs-wizard.max
.js' ] }
uglify:
{ 'dist\\scripts\\components.js': 'dist\\scripts\\components.js',
'dist\\scripts\\templates.js': 'dist\\scripts\\templates.js',
'dist\\scripts\\main.js': 'dist\\scripts\\main.js',
'dist\\scripts\\plugins.js': 'dist\\scripts\\plugins.js' }
requirejs:
{}
Running "concurrent:dist" (concurrent) task
Running "imagemin:dist" (imagemin) task
Minified 0 images (saved 0 B)
Done, without errors.
Running "svgmin:dist" (svgmin) task
Done, without errors.
Running "htmlmin:dist" (htmlmin) task
File dist/index.html created.
Done, without errors.
Running "emberTemplates:dist" (emberTemplates) task
File ".tmp/scripts/compiled-templates.js" created.
Done, without errors.
Running "compass:dist" (compass) task
directory .tmp/styles/
create .tmp/styles/style.css (2.682s)
Compilation took 2.686s
Done, without errors.
Running "neuter:app" (neuter) task
Running "concat:dist\styles\main.css" (concat) task
File "dist\styles\main.css" created.
Running "concat:dist\scripts\components.js" (concat) task
File "dist\scripts\components.js" created.
Running "concat:dist\scripts\templates.js" (concat) task
File "dist\scripts\templates.js" created.
Running "concat:dist\scripts\main.js" (concat) task
File "dist\scripts\main.js" created.
Running "concat:dist\scripts\plugins.js" (concat) task
File "dist\scripts\plugins.js" created.
Running "cssmin:dist" (cssmin) task
File dist/styles/main.css created.
Running "cssmin:dist\styles\main.css" (cssmin) task
File dist\styles\main.css created.
Running "uglify:dist\scripts\components.js" (uglify) task
File "dist\scripts\components.js" created.
Running "uglify:dist\scripts\templates.js" (uglify) task
File "dist\scripts\templates.js" created.
Running "uglify:dist\scripts\main.js" (uglify) task
File "dist\scripts\main.js" created.
Running "uglify:dist\scripts\plugins.js" (uglify) task
File "dist\scripts\plugins.js" created.
Running "copy:fonts" (copy) task
Copied 9 files
Running "copy:dist" (copy) task
Copied 9 files
Running "rev:dist" (rev) task
dist/scripts/components.js >> bb1ae45b.components.js
dist/scripts/main.js >> 69c75525.main.js
dist/scripts/plugins.js >> d41d8cd9.plugins.js
dist/scripts/templates.js >> e425eb4f.templates.js
dist/styles/main.css >> 5baff5b5.main.css
dist/styles/fonts/FontAwesome.otf >> 543846b5.FontAwesome.otf
dist/styles/fonts/fontawesome-webfont.eot >> 906d33f8.fontawesome-webfont.eot
dist/styles/fonts/fontawesome-webfont.svg >> 776d58f4.fontawesome-webfont.svg
dist/styles/fonts/fontawesome-webfont.ttf >> 370c636d.fontawesome-webfont.ttf
dist/styles/fonts/fontawesome-webfont.woff >> 3f97f72d.fontawesome-webfont.woff
dist/styles/fonts/glyphicons-halflings-regular.eot >> e56f39cb.glyphicons-halfli
ngs-regular.eot
dist/styles/fonts/glyphicons-halflings-regular.svg >> 32941d63.glyphicons-halfli
ngs-regular.svg
dist/styles/fonts/glyphicons-halflings-regular.ttf >> 38e827a0.glyphicons-halfli
ngs-regular.ttf
dist/styles/fonts/glyphicons-halflings-regular.woff >> deae260a.glyphicons-halfl
ings-regular.woff
Running "usemin:html" (usemin) task
Processing as HTML - dist/index.html
Update the HTML to reference our concat/min/revved script files
Update the HTML with the new css filenames
Update the HTML with the new img filenames
Update the HTML with data-main tags
Update the HTML with the data tags
Update the HTML with background imgs, case there is some inline style
Update the HTML with anchors images
Update the HTML with reference in input
Running "usemin:css" (usemin) task
Processing as CSS - dist/styles/5baff5b5.main.css
Update the CSS with new img filenames
url(../styles/fonts/glyphicons-halflings-regular.eot) changed to url(../styles/f
onts/e56f39cb.glyphicons-halflings-regular.eot)
url(../styles/fonts/glyphicons-halflings-regular.eot?#iefix) changed to url(../s
tyles/fonts/e56f39cb.glyphicons-halflings-regular.eot?#iefix)
url(../styles/fonts/glyphicons-halflings-regular.woff) changed to url(../styles/
fonts/deae260a.glyphicons-halflings-regular.woff)
url(../styles/fonts/glyphicons-halflings-regular.ttf) changed to url(../styles/f
onts/38e827a0.glyphicons-halflings-regular.ttf)
url(../styles/fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular
) changed to url(../styles/fonts/32941d63.glyphicons-halflings-regular.svg#glyph
icons_halflingsregular)
Done, without errors.
最佳答案
好吧,这是有史以来最愚蠢的事情似乎 usemin 无法处理 Windows 新行,所以它只是默默地失败更新 html 文件......我已将所有新行更改为 UNIX 新行并且它有效...
发现这个错误非常困难:(
关于gruntjs - grunt usemin 不影响 html 文件(index.html),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23895397/
我安装了 grunt 和 grunt cli,但仍然出现命令未找到错误 { "name": "angulartdd", "version": "1.0.0", "description":
我有一个使用“grunt-contrib-watch”和“grunt-exec”的 Grunt.js 文件,这是因为我想以一种独特的方式使用 handlebars 预编译器的一些自定义功能。 代码:
我正忙于尝试完成我正在运行的部署脚本。它可能有一半的时间有效,而且令人沮丧,因为我使用的大部分代码都不是我写的。我真的希望有一个我可以执行的较低级别的解决方法。 基本上发生的事情是我正在尝试执行 5
我想像在文档中定义的那样将参数传递给grunt-shell: module.exports = function(grunt) { // Configure Grunt grunt.initConfi
背景 我正在使用 Yeoman webapp 来搭建我的前端。 在 gruntfile 中,他们使用 grunt-rev 和 grunt-usemin Grunt-rev 将“修改”我的 Assets
我已经设置了grunt-eslint在我的 gruntfile.js 中,但是当我运行“grunt eslint”时,什么也没有发生。该任务看似即将开始,但 15 分钟后却停滞不前。 我的所有其他任务
我最近开始使用 grunt 做 JS 项目。 我有一个名为“grunt-contrib-jasmine”的插件用于 Jasmine 测试。我工作得很好,但我无法在浏览器中通过 specrunner 运
谁能告诉我这里做错了什么(我是 grunt 的新手)一个大学给我提供了一个基本的 gruntfile 设置 我已经安装了 node、js 和 grunt,但我不知道如何安装各种包(uglify、con
我正在尝试使用 grunt-contrib-watch和 grunt-rsync将任何文件更改上传到我的开发服务器。这是我的设置: var path = require('path'); module
尝试使用grunt-kill创建一个任务来终止我的 server-scorm 任务,并最终终止所有相关任务。这些说明非常短,因为它假设我知道有关 PID 文件的所有信息(我不知道,不是开发人员的错误)
我要么脑子一片空白,要么本该更复杂。 我正在尝试从 Grunt 任务运行 grunt-init,如下所示: grunt.registerTask('init', 'Scaffold various a
我有一个从玩家发射的射弹预制件,当它与“边界”碰撞时,它应该摧毁自己,当它击中“咕噜声”时,它应该摧毁自己和咕噜声。但是,当它碰到边界时,它会破坏自身和边界的对撞机。我创建了一个自定义标签脚本,允许我
module.exports = function(grunt){ grunt.initConfig({ pkg: grunt.file.readJSON('package.json'),
我已经加入了一个非营利性开源项目,想帮点忙,但我对 Grunt 不熟悉。我做了一些研究,但无法弄清楚为什么配置不起作用。 这是我正在尝试使用的插件。它允许应用多个后处理器,但我现在只需要 Autopr
下面的代码读取app/modules/中的每个子目录js的内容(例如app/modules/module1/js/, app/modules/module2/js/, aso.) 此脚本在不使用最后一
我正在尝试使用 grunt-exec 运行一个 javascript 测试运行程序,并传入一个已部署的链接变量。 我尝试通过使用 exec:setLink 设置环境变量 grunt.option('l
当我使用 grunt-contrib-watch 更改我的 js 文件时,我试图让 Grunt 重新加载它们。这是我的 Gruntfile: module.exports = function(gru
所以我的意思是: grunt.registerTask('default', ['default']); // CLI: grunt grunt.registerTask('serve', ['ser
我想创建一个通用的顶级 Gruntfile.js,配置为监视较少的文件更改。当less文件发生变化时,我想将其编译为css,然后在浏览器中实时加载css文件。我的功能正常,但我必须为每个项目复制 Gr
我正在使用 grunt-xmlpoke 更新 xml 文件。 xml 文件的路径作为参数提供。问题是文件部分中的第一个 WebConfigPath (键)被视为字符串。它更新了我的 xml 文件的本地
我是一名优秀的程序员,十分优秀!