1
0
mirror of https://github.com/tobspr/shapez.io.git synced 2024-09-30 18:20:45 +00:00
tobspr_shapez.io/gulp/loader.strip_block.js

22 lines
526 B
JavaScript
Raw Normal View History

2020-05-09 14:45:23 +00:00
/*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;