Skip to content
This repository has been archived by the owner on Apr 20, 2018. It is now read-only.

If a html file has Windows line feeds, usemin will silently not replace the blocks #617

Open
needcaffeine opened this issue Feb 25, 2016 · 3 comments

Comments

@needcaffeine
Copy link

Converting the file to have Unix line feeds allows usemin to succeed.

@ThomasHambach
Copy link

Try using the patch in #604 or changing the package.json to refer to https://github.com/lu4/grunt-usemin

@BouncingBit
Copy link

This is indeed a problem if you yourself are working on a Mac or Unix system and your colleagues or the build system is running on Windows and you're using GIT. Depending on the GIT flag core.autocrlf the line endings are automatically converted (core.autocrlf = true as recommended for Windows).

Steps to reproduce:

  1. create a simple html file with two build tags after each other
  2. use the default setup for usemin
  3. checkout the code with your Windows machine where git's config is set to core.autocrlf is set to true
  4. run the build and notice, that the second <!-- build:js ... > tag is still there and not replaced.

@fbarbat
Copy link

fbarbat commented Apr 26, 2017

In case it helps, here it is another workaround. We ended up using grunt-lineending before usemin so it replaces all Windows line feeds.

lineending: {
  dist: {
    options: {
      overwrite: true
    },
    files: {
      '': ['<%= dist %>/index.html']
    }
  }
}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants