Remove JS obfuscator that broke Mapbox GL map rendering
vite-plugin-obfuscator processes ALL output chunks including vendor libraries, corrupting Mapbox GL's WebGL shader string literals via base64 encoding and string splitting. This caused the map to render as a blank screen in production. Vite's built-in esbuild minification already mangles identifiers and removes whitespace, providing sufficient code protection. Adds regression tests to prevent re-introducing obfuscation plugins.
This commit is contained in:
parent
6a1c35946e
commit
7319f77f1d
6 changed files with 49 additions and 1255 deletions
|
|
@ -3,26 +3,12 @@ import react from '@vitejs/plugin-react-swc';
|
|||
import path from "path";
|
||||
import { env } from "process";
|
||||
import { defineConfig } from 'vite';
|
||||
import { viteObfuscateFile } from 'vite-plugin-obfuscator';
|
||||
|
||||
// https://vite.dev/config/
|
||||
export default defineConfig({
|
||||
plugins: [
|
||||
react(),
|
||||
tailwindcss(),
|
||||
viteObfuscateFile({
|
||||
compact: true,
|
||||
controlFlowFlattening: false,
|
||||
deadCodeInjection: false,
|
||||
debugProtection: false,
|
||||
identifierNamesGenerator: 'hexadecimal',
|
||||
renameGlobals: false,
|
||||
stringArray: true,
|
||||
stringArrayThreshold: 0.75,
|
||||
stringArrayEncoding: ['base64'],
|
||||
splitStrings: true,
|
||||
splitStringsChunkLength: 10,
|
||||
}),
|
||||
],
|
||||
build: {
|
||||
outDir: "dist",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue