grunt usemin 不影响 html 文件(index.html)

2023-11-25

我有一个使用 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 -->

日志中最奇怪的部分是这个(尽管它找到了块,但它什么也没做 - 请参阅完整日志):

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 新行并且它有效...

发现这个错误非常困难:(

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

grunt usemin 不影响 html 文件(index.html) 的相关文章

  • Grunt 未定义

    刚开始使用 grunt 当我跑步时grunt我收到这个错误 Loading Gruntfile js tasks ERROR gt gt ReferenceError grunt is not defined 这是我的 Gruntfile
  • 在 Ember.JS ember-cli 应用程序中包含引导库的推荐方法

    我正在尝试在当前的 ember cli 项目中正确安装 Twitter Bootstrap 我确实用 Bower 安装了 bootstrap bower install save bootstrap 现在库已下载到 vendor boots
  • 如果目录为空,如何跳过 grunt 任务

    我正在使用 grunt contrib 的concat and uglify处理一些 javascript 的模块 目前如果src js 是空的 他们仍然会创建一个 空 连接文件 以及缩小版本和源映射 我想要检测是否src js 继续之前文
  • grunt-terser 给出语法错误:“VARIABLE_NAME”被重新声明

    我在用着咕噜语 https www npmjs com package grunt terser缩小我的 es6 文件 我有两个文件 文件1 js 文件2 js 在这两个文件中 我需要一个具有相同变量名称的模块 如下所示 const VAR
  • Grunt 将每个目录中的所有 .less 编译为 .css

    因此 我已将站点设置为使用模块 其中每个模块都有自己的 less 文件 需要将其编译为 css 文件夹结构 common modules module name style less 我需要将所有 style less 文件转换为同一目录中
  • grunt-contrib-build' 不在 npm 注册表中

    当我尝试安装时出现以下错误npm install grunt contrib build save dev在我的 Windows 7 系统上使用命令提示符 C css base gt npm install grunt contrib bu
  • ASP .NET 5 - 将文件从节点模块复制到 wwwroot 的 grunt 任务

    我有一个简单的 ASP NET 5 空项目 安装了 npm 和 grunt 我使用 npm 安装了一些客户端库 目前位于我的 ASP NET 项目下的 node modules 目录中 我想将相关文件 例如 jquery min js 从n
  • 无法找到适合角度 - Bower 安装的版本

    我已经设置了我的 Angular 应用程序 因此当它被推送到 Heroku 时它就会运行bower install 但是由于版本问题 我收到了错误 当我跑步时bower install在本地我得到了这个 Unable to find a s
  • 在虚拟机共享目录上运行“grunt”

    将 Vagrant 与 Windows 主机和 Linux 客户机一起使用 grunt尝试运行作业时返回以下错误 据我了解 在主机 来宾共享目录中 此文件路径超出了 Windows 的 255 个字符限制 npm ERR Error EPE
  • 对字体(font-awesome)资源的引用未在 yeoman/Angular grunt 构建中更新

    我知道有关此问题的SO线程 我在下面链接了它们 但不幸的是我无法用它们解决这个问题 所以请允许我这个问题 我使用 Yeoman 启动了一个 AngularJS 项目 因此依赖于使用 Bower js 和 SCSS 的 grunt js 构建
  • 使用 grunt 从 browserify 生成源映射

    我已按照此处的说明进行操作 https www npmjs org package grunt browserify https www npmjs org package grunt browserify 尝试在 grunt 上为 bro
  • grunt jasmine-node 测试运行两次

    我设置 grunt 来运行 node js 茉莉花测试 由于某种原因 使用此配置 结果总是显示双倍的测试 这是我的配置 我在用着茉莉花节点 https github com jasmine contrib grunt jasmine nod
  • 为什么 Yeoman 构建时没有字形图标?

    我正在研究一个webapp发电机及运行后grunt我有一个可以正确显示字体的功能应用程序 然而 当我检查dist 目录我没有得到任何字体文件 文档指出grunt命令build the application for deployment 但
  • 如何通过 Grunt 运行节点脚本?

    我希望通过我的 gruntfile 运行节点命令 我只需要运行 node index js 作为任何其他任务之前的第一个任务 我尝试四处寻找但没有找到答案 我相信这可能很简单 但我不确定如何做 我需要加载 nmp 任务吗 这就是我的 Gru
  • grunt:如何生成 HTML 形式的 jshint 输出

    我正在尝试使用 grunt 运行 jshint 这可行 但现在我希望输出为 HTML 这是我的 grunt 文件 module exports function grunt Project configuration grunt initC
  • 如何使用 fs.copyTpl 忽略 Yeoman 中的文件

    我怎样才能忽略文件 我想排除任何子目录中以 开头的所有文件 我使用这两种方法没有成功 this fs copyTpl this templatePath basicFiles this destinationPath answers ign
  • 有没有等效的 gulp 插件来执行“grunt Bower”?

    With grunt 我可以使用命令grunt bower 由 提供grunt bower requirejs https github com ck86 gulp bower files 自动生成RequireJS我本地的配置文件bowe
  • AngularJS with Grunt - 连接到另一台服务器

    我使用 grunt bower 和 yeoman 创建了一个 AngularJS 应用程序 我猜想 Gruntfile js 在 2014 年 1 月之后发生了变化 不确定 这是我的gruntfile js Generated on 201
  • 列出 grunt.js 任务

    我正在尝试弄清楚如何打印所有可用的 grunt 任务的列表 如果使用耙子 则为 rake T grunt 相当于什么 例如 grunt T concat jasmine minify grunt help列出可用的任务
  • 将 Bootstrap 与 Bower 一起使用

    我正在尝试将 Bootstrap 与 Bower 一起使用 但由于它克隆了整个存储库 因此没有 CSS 和其他内容 这是否意味着我需要在我自己的构建过程中包含构建 Bootstrap 或者如果我错了 正确的工作流程是什么 I finally

随机推荐

  • 为什么 python 对文件句柄的数量有限制?

    我编写了简单的代码进行测试 在 python 脚本中可以打开多少文件 for i in xrange 2000 fp open files file d i w fp write str i fp close fps for x in xr
  • 自旋锁与 std::mutex::try_lock

    使用专门设计的自旋锁有什么好处 例如http anki3d org spinlock 与这样的代码 std mutex m while m try lock do work m unlock 在典型的硬件上 有巨大的好处 你天真的 假自旋锁
  • 这个字符是什么? 65279''

    我有两根弦 一个是 另一个是 我认为它们是相同的 然而 String Compare说他们是不同的 这很奇怪 这是我的代码 string b string c if string Compare b c 0 Console WriteLin
  • Server 2008 R2 上的 MVC - 如何?

    我有一个新的 WIndows Server 2008 R2 x64 DataCentre 安装了 Framework 3 5 SP1 和 Framework 4 当我安装 MVC 应用程序 使用 Web 安装项目安装程序的 VS 2008
  • Python:给出给定日期的周开始和结束数据

    day 13 Oct 2013 print Parsing day day mon yr day split sday yr day mon myday time strptime sday Y d b Sstart yr time str
  • Java 类相互引用

    我有两个java类文件 他们每个人都有对方使用的方法 public class class1 class2 c2 new class2 m1 c2 ma m2 m2 public class class2 class1 c1 new cla
  • .net Framework 4.0 的 File.ReadLines(..) 方法中的错误

    这段代码 IEnumerable
  • Proguard 和 Android :(

    我试图在我的 Android 应用程序上运行 Proguard 并遇到问题 我正在使用 SpongyCastle jar 完整的充气城堡的复制和过去 并重命名了包 因此它不会与 Android 充气城堡内置版本冲突 运行 proguard
  • 移动某些数组元素的函数方法如何?

    我有一个 Scala 应用程序 其中包含带有复选框的项目列表 以便用户选择一些项目 然后单击按钮将它们向上移动一个位置 左 我决定编写一个函数来移动满足给定谓词的某种任意类型的元素 所以 如果你有这些元素 a b c D E f g h I
  • 将纪元时间转换为具有特定时区的人类可读时间

    要将纪元日期时间转换为人类可读的 使用一个简单的new date 1495159447834 就足够了 我现在遇到的问题是 对于我的混合应用程序 如果用户将手机日期时间设置中的时区设置为 GMT 12 00 则人类可读的日期时间将与我想要的
  • 查找 Java 方法的字节码大小

    我试图计算出方法的字节码大小 因为我想确保它足够小 可以通过编译器优化内联 我看到内联方法的默认最大大小是 35 因此如果该方法大于该大小 我将修改代码或将其分解为多个方法 我有一个方法可以生成下面的字节码 通过 IntelliJ IDEA
  • SQL除两个整数并得到小数值错误[重复]

    这个问题在这里已经有答案了 在 SQL 语句中 我试图除以两个整数 整数 1 在我的代码中为 abc 整数 2 在我的代码中为 xyz 并得到十进制结果 在我的代码中为 def 小数结果应仅以 1 或 0 开头 后跟一个小数和小数点后 3
  • 如何在javascript中获取json键和值?

    我返回一个 json 如下所示 name skills jobtitel Entwickler res linkedin GwebSearch 我试图获取每个元素的键和值 done function data alert data jobt
  • Summernote - 图片 url 而不是 Base64

    Summernote wysiwyg 编辑器将图像文件编码为 Base64 嗯 这看起来很方便 但我预计数据库会在长期内被大量使用 这会导致一些问题 搜索速度慢 实现图像库等等 我想知道它是否有一个选项可以关闭此编码选项并使用 插入 url
  • 获取摆动组件的位置

    我已将一些 JPanel 放入另一个 JPanel 中 其布局是框布局和 Y 轴 放置所有面板后 我需要从 JPanel 容器面板中获取每个添加的 JPanel 的 Y 位置 但是 当我尝试得到这个值时 每个 JPanel 的 Y 位置总是
  • 为什么 Python 使用“魔法方法”?

    我对 Python 广泛使用 魔术方法 感到有点惊讶 例如 为了让一个类声明实例具有 长度 它实现了 len 方法 当您编写时会调用该方法len obj 为什么不直接定义一个len作为对象的成员直接调 用的方法 例如obj len See
  • SQL Server 中的可选参数

    我有一个用户定义的函数 在许多存储过程中使用 它将返回一些值 如果我可以添加一个新的可选参数 如果我不传递任何值 它应该为空 如果我传递一些值 它应该接受它 我不想去更改所有存储过程来执行此操作 示例代码 dbo CalculateAver
  • Jenkins Git 插件不接收发布的参数

    我正在尝试使用 Node js 以编程方式构建采用 Git 参数的 Jenkins 作业 我将参数作为发布数据发送 如下所示 但是 无论我分配什么值ref Jenkins 使用默认参数值 在作业配置中指定 运行构建 我尝试过将参数作为查询字
  • 使用 D3 画笔进行细粒度事件处理

    我有一个使用 D3 生成的散点图 可以通过单击绘图上的点 SVG 圆圈 来选择它们 并且可以使用 D3 画笔选择区域 为了确保圆圈获得单击事件 我需要首先创建画笔 以便圆圈位于其上方 不幸的是 这意味着当我的光标位于绘图中的某个点上时 我无
  • grunt usemin 不影响 html 文件(index.html)

    我有一个使用 usemin 的 grunt 脚本 但奇怪的是 index html 文件根本不受 usemin 影响 这意味着我的文件仍然包含所有 日志中最奇怪的部分是这个 尽管它找到了块 但它什么也没做 请参阅完整日志 Processin