soranoo / next-css-obfuscator

A package deeply inspired by PostCSS-Obfuscator but for Next.js.
https://next-css-obfuscator.vercel.app
MIT License
71 stars 3 forks source link

Laravel Breeze NextJS: the obfuscator doesn't work with laravel #40

Closed WavaDev closed 3 months ago

WavaDev commented 3 months ago

Type

Checklist

  1. [x] Updated the package to the latest version
  2. [x] Read all documentation
  3. [x] No related issue
  4. [x] Meaningful issue title

Environment

Describe the bug The issue is that Laravel doesn't use npm start - it works right after using npm run build. However, the obfuscator runs after the build, so the application doesn't update.

To Reproduce Steps to reproduce the behavior:

  1. Install Laravel Breeze NextJS: laravel new my-app --typescript --breeze --stack=react --git --no-interaction
  2. Install the package.
  3. Follow the documentation
  4. Just run it.

Screenshots image

Config

module.exports = {
    enable: true,
    mode: "random", // random | simplify | simplify-seedable
    refreshClassConversionJson: false, // recommended set to true if not in production
    allowExtensions: [".jsx", ".tsx", ".js", ".ts", ".html", ".rsc"],
    buildFolderPath: "public/build/assets", // Build folder of your project.
  };
   "scripts": {
        "dev": "vite",
        "build": "tsc && vite build && next-css-obfuscator"
    },
soranoo commented 3 months ago

It works in my dev env with your config.

You may try to enable enableJsAst inside your config.

WavaDev commented 3 months ago

It works in my dev env with your config.

You may try to enable enableJsAst inside your config.

Thanks, that works.