prttco / obfuscit

Plugin for Vite that helps you protect your stylesheet code by obfuscating TailwindCSS, Bulma, Bootstrap and more
https://www.npmjs.com/package/obfuscit
MIT License
12 stars 0 forks source link

🐛Bug: Broken for Svelte kit >2.0 #2

Open reikrom opened 6 months ago

reikrom commented 6 months ago
// svelte.config.js
import adapter from '@sveltejs/adapter-auto';
import twObfuscator from 'tailwind-obfuscator';

import { vitePreprocess } from '@sveltejs/vite-plugin-svelte';
/** @type {import('@sveltejs/kit').Config} */
const config = {
    preprocess: [
        vitePreprocess(),
        twObfuscator({
            enable: true // Set to true to enable class obfuscation (default is true)
        })
    ],

    kit: {
        adapter: adapter()
    }
};

export default config;
error when starting dev server:
SyntaxError: Unexpected end of JSON input
    at JSON.parse (<anonymous>)
    at Obfuscate (file:///home/rei/github/svelte-corp-website/node_modules/tailwind-obfuscator/src/twObfuscator.js:21:31)
    at file:///home/rei/github/svelte-corp-website/svelte.config.js?ts=1703803902363:11:3
    at ModuleJob.run (node:internal/modules/esm/module_job:218:25)
    at async ModuleLoader.import (node:internal/modules/esm/loader:329:24)
    at async load_config (file:///home/rei/github/svelte-corp-website/node_modules/@sveltejs/kit/src/core/config/index.js:70:17)
    at async sveltekit (file:///home/rei/github/svelte-corp-website/node_modules/@sveltejs/kit/src/exports/vite/index.js:130:24)
    at async Promise.all (index 0)
    at async asyncFlatten (file:///home/rei/github/svelte-corp-website/node_modules/vite/dist/node/chunks/dep-R0I0XnyH.js:12894:16)
    at async resolveConfig (file:///home/rei/github/svelte-corp-website/node_modules/vite/dist/node/chunks/dep-R0I0XnyH.js:67500:29)
prttco commented 4 months ago

Hi @reikrom,

I apologize for the delay in my response. Thank you for your feedback and for trying out the suggested changes. I've released a new version that includes potential fixes for the reported error. Please update to the latest version, and let me know if the issue persists.

I appreciate your patience and understanding. Your feedback on whether the problem is resolved with the new release would be greatly appreciated. If you encounter any further issues or have additional details to share, feel free to provide them so that I can assist you more effectively.

Once again, I'm sorry for any inconvenience caused by the delayed response.