blob: c2f96364c3a850d421e4f3bb69cbe2c22a958880 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
const path = require("path");
const scripts = require(path.resolve(SOURCE_DIR, "scripts.json"));
const getScriptType = scriptName => {
for (const scriptType in scripts) {
if (scripts[scriptType][scriptName]) {
return scriptType;
}
}
return "undefined_script";
};
module.exports = function (source) {
return `/*<--\t${getScriptType(path.basename(this.resourcePath))}\t-->*/
(() => {\n${source}\n})();
/*<---->*/`
};
|