You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
526 B
22 lines
526 B
4 years ago
|
/*jslint node:true */
|
||
|
"use strict";
|
||
|
|
||
|
const startComment = "typehints:start";
|
||
|
const endComment = "typehints:end";
|
||
|
const regexPattern = new RegExp(
|
||
|
"[\\t ]*\\/\\* ?" + startComment + " ?\\*\\/[\\s\\S]*?\\/\\* ?" + endComment + " ?\\*\\/[\\t ]*\\n?",
|
||
|
"g"
|
||
|
);
|
||
|
|
||
|
function StripBlockLoader(content) {
|
||
|
if (content.indexOf(startComment) >= 0) {
|
||
|
content = content.replace(regexPattern, "");
|
||
|
}
|
||
|
if (this.cacheable) {
|
||
|
this.cacheable(true);
|
||
|
}
|
||
|
return content;
|
||
|
}
|
||
|
|
||
|
module.exports = StripBlockLoader;
|