mirror of
https://github.com/D00Movenok/HTMLSmuggler
synced 2026-06-08 10:49:16 +00:00
43 lines
950 B
JavaScript
43 lines
950 B
JavaScript
const path = require("path");
|
|
const webpack = require("webpack");
|
|
const WebpackObfuscator = require("webpack-obfuscator");
|
|
const obfuscatorOptions = require("./obfuscator");
|
|
|
|
module.exports = ({ name, type, compress }) => ({
|
|
mode: "production",
|
|
performance: {
|
|
hints: false,
|
|
maxEntrypointSize: 512000,
|
|
maxAssetSize: 512000,
|
|
},
|
|
entry: "./src/index.js",
|
|
output: {
|
|
path: path.resolve(__dirname, "dist"),
|
|
filename: "index.js",
|
|
libraryTarget: "window",
|
|
},
|
|
module: {
|
|
rules: [
|
|
{
|
|
test: /assets\/.*/,
|
|
use: "binary-loader",
|
|
},
|
|
{
|
|
test: /.*/,
|
|
enforce: "post",
|
|
use: {
|
|
loader: WebpackObfuscator.loader,
|
|
options: obfuscatorOptions,
|
|
},
|
|
},
|
|
],
|
|
},
|
|
plugins: [
|
|
new webpack.DefinePlugin({
|
|
FILENAME: JSON.stringify(name),
|
|
CONTENTTYPE: JSON.stringify(type),
|
|
COMPRESS: JSON.stringify(compress),
|
|
}),
|
|
],
|
|
});
|