ghostdevv / rollup-obfuscator

A plugin to obfuscate javascript for rollup based on https://www.npmjs.com/javascript-obfuscator
MIT License
56 stars 7 forks source link

Nuxt 3 support? #135

Closed erisvn closed 1 year ago

erisvn commented 2 years ago

I tried it with nuxt 3 but got an error, will it support nuxt 3 in the future

ghostdevv commented 2 years ago

Could you provide more details on the error you got? @ERIS-VN

erisvn commented 2 years ago

Issue with vue router image image image

erisvn commented 2 years ago

any help :<

ghostdevv commented 2 years ago

I will take a look for you tomorrow

ghostdevv commented 2 years ago

At a guess it's probably that nuxt can't handle the default obfuscation settings, it's not uncommon - you might wanna try playing with them to see what happens

erisvn commented 1 year ago

I have tried many ways but it still doesn't work, I have also used some other rollup packages but they either don't obfuscate the script or have errors during the rollup process

erisvn commented 1 year ago

image

ghostdevv commented 1 year ago

If there is an error when trying to run the obfuscated code you will need to edit the obfuscator settings to make it change the code less

ghostdevv commented 1 year ago

Going to close this for now, but another recommendation I just thought of would be only running this plugin during the build. Something like this:

import { obfuscator } from 'rollup-obfuscator';

export default defineNuxtConfig({
  devtools: { enabled: true },
  vite: {
    build: {
      rollupOptions: {
        plugins: [obfuscator()]
      }
    }
  }
})