This repository has been archived on 2021-02-20. You can view files and clone it, but cannot push or open issues or pull requests.
shapez.io/gulp/loader.strip_block.js

22 lines
526 B
JavaScript

/*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;