z0ffy / vite-plugin-bundle-obfuscator

JavaScript obfuscator plugin for Vite, offering customizable options and multi-threading support to strengthen code security.
https://github.com/z0ffy/vite-plugin-bundle-obfuscator
MIT License
37 stars 0 forks source link

怎么把依赖目录设为白名单 #23

Closed setube closed 1 month ago

setube commented 1 month ago

我尝试在excludes里使用/node_modules/,node_modules/**,node_modules都不行

z0ffy commented 1 month ago

可以暂时先这么配置来用。之后会改进这块,支持类似 /node_modules/,node_modules/**,node_modules 这种配置

// vite.config.js

import obfuscatorPlugin from 'vite-plugin-bundle-obfuscator';

export default defineConfig({
  plugins: [
    obfuscatorPlugin({
      excludes: ['vendor-modules'],
    })
  ],
  build: {
    rollupOptions: {
      output: {
        manualChunks(id) {
          if (id.includes('node_modules')) {
            return 'vendor-modules';
          }
        },
      },
    },
  }
})
setube commented 1 month ago

那跟我目前差不多,更新了踢我一脚

z0ffy commented 1 month ago

那跟我目前差不多,更新了踢我一脚

好的👌