forked from javascript-obfuscator/javascript-obfuscator
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWebpackUtils.js
More file actions
29 lines (23 loc) · 767 Bytes
/
WebpackUtils.js
File metadata and controls
29 lines (23 loc) · 767 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
const fs = require('fs');
const copyright = 'Copyright (C) 2016-2020 Timofey Kachalov <sanex3339@yandex.ru>';
const sourceMapSupportRequire = 'require("source-map-support").install();';
class WebpackUtils {
/**
* @param entries
* @returns {string[]}
*/
static getBannerText (...entries) {
const lineSeparator = '\n\n';
return entries.reduce((bannerText, entry) => {
return `${bannerText}${entry}${lineSeparator}`
}, '');
}
static getLicenseText () {
return `/*!\n${copyright}\n\n` +
fs.readFileSync('./LICENSE.BSD', 'utf8') + "\n*/";
}
static getSourceMapSupportImport () {
return sourceMapSupportRequire;
}
}
module.exports.WebpackUtils = WebpackUtils;