@@ -19,14 +19,15 @@ import {
1919 obfuscateBundle ,
2020 obfuscateLibBundle ,
2121} from './utils' ;
22- import { isArray , isFunction , isLibMode , isNuxtProject , isObject } from './utils/is' ;
22+ import { isArray , isFunction , isLaravelProject , isLibMode , isNuxtProject , isObject } from './utils/is' ;
2323import { defaultConfig , LOG_COLOR , NODE_MODULES , VENDOR_MODULES } from './utils/constants' ;
2424
2525export default function viteBundleObfuscator ( config ?: Partial < Config > ) : PluginOption {
2626 const finalConfig : Config = { ...defaultConfig , ...config } ;
2727 const _log = new Log ( finalConfig . log ) ;
2828 let _isLibMode = false ;
2929 let _isNuxtProject = false ;
30+ let _isLaravelProject = false ;
3031 let _isSsrBuild = false ;
3132
3233 const obfuscateAllChunks = async (
@@ -66,6 +67,7 @@ export default function viteBundleObfuscator(config?: Partial<Config>): PluginOp
6667 _isSsrBuild = ! ! env . isSsrBuild ;
6768 _isLibMode = isLibMode ( config ) ;
6869 _isNuxtProject = isNuxtProject ( config ) ;
70+ _isLaravelProject = isLaravelProject ( config ) ;
6971
7072 if ( finalConfig . enable && isEnabledFeature ( finalConfig . obfuscateWorker ) ) {
7173 const original = config . worker ?. plugins ;
@@ -190,7 +192,8 @@ export default function viteBundleObfuscator(config?: Partial<Config>): PluginOp
190192 } ;
191193
192194 const generateBundleHandler : Rollup . Plugin [ 'generateBundle' ] = async ( _ , bundle ) => {
193- if ( ! finalConfig . enable || ! bundle || _isLibMode || ! _isNuxtProject || _isSsrBuild ) return ;
195+ if ( ! finalConfig . enable || ! bundle || _isLibMode || _isSsrBuild ) return ;
196+ if ( ! _isNuxtProject && ! _isLaravelProject ) return ;
194197 await obfuscateAllChunks ( bundle ) ;
195198 } ;
196199
0 commit comments