webpack.config.js 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. const path = require('path');
  2. const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
  3. const WebpackObfuscator = require('webpack-obfuscator');
  4. module.exports = {
  5. mode: 'production',
  6. entry: {
  7. youtube: './youtube/youtube.js',
  8. pornhub: './pornhub/pornhub.js',
  9. xvideos: './xvideos/xvideos.js',
  10. tiktok: './tiktok/tiktok.js'
  11. },
  12. output: {
  13. path: path.resolve(__dirname),
  14. filename: '[name].bundle.js',
  15. },
  16. optimization: {
  17. minimizer: [
  18. new UglifyJsPlugin({
  19. uglifyOptions: {
  20. mangle: {
  21. reserved: ['detail', 'search'], // 保留指定函数名
  22. },
  23. compress: {
  24. // 压缩选项配置
  25. unused: true,
  26. dead_code: true,
  27. // drop_console: true,
  28. },
  29. output: {
  30. beautify: false, // 禁用美化输出
  31. },
  32. },
  33. }),
  34. ],
  35. },
  36. plugins: [
  37. new WebpackObfuscator({
  38. rotateUnicodeArray: true,
  39. compact: true,
  40. stringArray: true,
  41. stringArrayEncoding: ['base64'],
  42. }),
  43. ],
  44. devtool: 'source-map'
  45. };