grunt usemin не влияет на файл html (index.html)

у меня есть скрипт grunt, который использует usemin, но странно то, что файл 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.

person kfir124    schedule 27.05.2014    source источник


Ответы (1)


ОК, ЭТО САМАЯ ГЛУПАЯ ВЕЩЬ похоже, что usemin не может обрабатывать новые строки Windows, поэтому просто не удается автоматически обновить html-файл... я изменил все свои новые строки на новые строки UNIX, и это работал...

было очень сложно обнаружить этот баг :(

person kfir124    schedule 28.05.2014
comment
+1.. Я использовал grunt-eol, чтобы установить окончания строк на моей цели файлы: eol: { dist: { options: { eol: 'lf', replace: true }, files: [{ src: ['<%= yeoman.dist %>/*.html'], }] } } - person Nick; 16.10.2014
comment
это, должно быть, было сломано в более новой версии usemin, поскольку, похоже, оно работает в 2.4.0. - person hannuraina; 02.12.2014
comment
@ kfir124 спасибо за это. Ваш ответ решил мою проблему после нескольких часов неудач :-) - person Dennis Ahaus; 26.03.2015
comment
Боже мой, я потратил столько часов на это сегодня, прежде чем нашел твой пост. - person Vic; 25.02.2016
comment
@Nick: Ты заслуживаешь так много голосов - я был ОЧЕНЬ расстроен, потому что моя сборка не удалась без видимой причины, хотя в последний день она работала отлично. Это действительно глупая проблема. БЛАГОДАРЮ ВАС - person puelo; 12.05.2016
comment
Благодарю вас! Вы сэкономили мне часы гугления! - person Andrea Silvestri; 03.04.2018