-
Notifications
You must be signed in to change notification settings - Fork 11
Open
Description
After add your plugin in the vite configure file and build the production asset. I try to open it but failed:
Failed to fetch dynamically imported module: http://localhost:4173/assets/chunk-!~%7B002%7D~.js
import {defineConfig} from 'vite'
import react from '@vitejs/plugin-react-swc'
import obfuscator from 'rollup-plugin-obfuscator'
import path from "path";
// https://vite.dev/config/
export default defineConfig({
plugins: [
react(),
obfuscator({
global: true,
options: {
compact: true,
controlFlowFlattening: true,
controlFlowFlatteningThreshold: 1,
deadCodeInjection: true,
deadCodeInjectionThreshold: 1,
debugProtection: true,
debugProtectionInterval: 1000,
disableConsoleOutput: true,
identifierNamesGenerator: 'hexadecimal',
log: false,
numbersToExpressions: true,
renameGlobals: false,
selfDefending: true,
simplify: true,
splitStrings: true,
splitStringsChunkLength: 5,
stringArray: true,
stringArrayCallsTransform: true,
stringArrayEncoding: ['base64'],
stringArrayIndexShift: true,
stringArrayRotate: true,
stringArrayShuffle: true,
stringArrayWrappersCount: 5,
stringArrayWrappersChainedCalls: true,
stringArrayWrappersParametersMaxCount: 5,
stringArrayWrappersType: 'function',
stringArrayThreshold: 1,
transformObjectKeys: true,
unicodeEscapeSequence: true
}
})
],
resolve: {
alias: {
// eslint-disable-next-line no-undef
'@': path.resolve(__dirname, './src'),
}
},
build: {
minify: 'esbuild',
target: "es2015",
rollupOptions: {
output: {
entryFileNames: `assets/index-[hash].js`,
chunkFileNames: `assets/chunk-[hash].js`,
assetFileNames: `assets/[name].[ext]`
}
}
},
esbuild: {
drop: ['console', 'debugger'],
}
})
Is it a bug? Or something is wrong with my configure file?
Metadata
Metadata
Assignees
Labels
No labels
