stealjs / steal-tools

Build easy. Load fast.

Home Page:https://stealjs.com/docs/steal-tools.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Steal-remove comments not getting removed in windows

green3g opened this issue · comments

Related to #950 (comment)

In windows, often times newlines aren't using the \n character (I wish they were always but occasionally they're not) and this can lead to hard to figure out issues...as development code isn't getting removed in production etc...

the (possible?) solution: also check for \r character?


function makeTagRegEx(tag) {
	return new RegExp(
		"(\\s?)//!(\\s?)" + tag + "-start((.|\n|\r)*?)//!(\\s?)" + tag + "-end",
		"gim"
	);
}

Edit: nope, that doesn't fix the issue either. So far my only workaround to this is to save the file using "LF" rather than CRLF line endings.

image