cd vue-project
npm install
npm install -D rollup-obfuscator javascript-obfuscator
Edit vite.config.ts
vim vite.config.ts
Build
npm run build
Error
vite v2.8.6 building for production...
✓ 0 modules transformed.
[obfuscator] Unexpected token (1:0)
file: C:/Users/user01/Desktop/vue-project/index.html
error during build:
Error: Unexpected token (1:0)
at Function.processParsingError (C:\Users\user01\Desktop\vue-project\node_modules\javascript-obfuscator\dist\webpack:\javascript-obfuscator\src\ASTParserFacade.ts:62:19)
at Function.parse (C:\Users\user01\Desktop\vue-project\node_modules\javascript-obfuscator\dist\webpack:\javascript-obfuscator\src\ASTParserFacade.ts:39:49)
at o.parseCode (C:\Users\user01\Desktop\vue-project\node_modules\javascript-obfuscator\dist\webpack:\javascript-obfuscator\src\JavaScriptObfuscator.ts:82:50)
at obfuscate (C:\Users\user01\Desktop\vue-project\node_modules\javascript-obfuscator\dist\webpack:\javascript-obfuscator\src\JavaScriptObfuscator.ts:73:30)
at obfuscate (C:\Users\user01\Desktop\vue-project\node_modules\javascript-obfuscator\dist\webpack:\javascript-obfuscator\src\JavaScriptObfuscatorFacade.ts:16:56)
at Object.transform (C:\Users\user01\Desktop\vue-project\node_modules\rollup-obfuscator\dist\index.js:43:69)
at C:\Users\user01\Desktop\vue-project\node_modules\rollup\dist\shared\rollup.js:22779:37
Steps to reproduce this issue
Init Vue3 project
Install modules
Edit vite.config.ts
Build
Error