mirror of
https://github.com/tobspr/shapez.io.git
synced 2026-09-25 05:14:41 +00:00
Initial commit
This commit is contained in:
21
gulp/loader.strip_block.js
Normal file
21
gulp/loader.strip_block.js
Normal file
@@ -0,0 +1,21 @@
|
||||
/*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;
|
||||
Reference in New Issue
Block a user