You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If global is set to false, Identifier "createApp" has already been declared.
To Reproduce
1.global is set to false
2.build the project
3.Identifier "createApp" has already been declared
Stack trace
[javascript-obfuscator] Obfuscation completed. Total time: 0.2 sec.
Identifier "createApp" has already been declared
file: E:/JumpPwd-chrome-extension/src/entries/popup/main.ts:1:9
1: import { createApp } from "vue";
^
2: import "@/style.css";
3: import App from "./App.vue";
error during build:
RollupError: Identifier "createApp" has already been declared
at error (file:///E:/JumpPwd-chrome-extension/node_modules/rollup/dist/es/shared/parseAst.js
:337:30)
at Module.error (file:///E:/JumpPwd-chrome-extension/node_modules/rollup/dist/es/shared/node
-entry.js:12738:16)
at Module.addImport (file:///E:/JumpPwd-chrome-extension/node_modules/rollup/dist/es/shared/
node-entry.js:13288:22)
at ImportDeclaration.initialise (file:///E:/JumpPwd-chrome-extension/node_modules/rollup/dis
t/es/shared/node-entry.js:9953:28)
at new NodeBase (file:///E:/JumpPwd-chrome-extension/node_modules/rollup/dist/es/shared/node
-entry.js:4607:14)
at new ImportDeclaration (file:///E:/JumpPwd-chrome-extension/node_modules/rollup/dist/es/sh
ared/node-entry.js:9946:1)
at Program.parseNode (file:///E:/JumpPwd-chrome-extension/node_modules/rollup/dist/es/shared
/node-entry.js:4718:27)
at new NodeBase (file:///E:/JumpPwd-chrome-extension/node_modules/rollup/dist/es/shared/node
-entry.js:4606:14)
at new Program (file:///E:/JumpPwd-chrome-extension/node_modules/rollup/dist/es/shared/node-
entry.js:10967:9)
at Module.setSource (file:///E:/JumpPwd-chrome-extension/node_modules/rollup/dist/es/shared/
node-entry.js:13119:20)
error Command failed with exit code 1.
Package versions:
rollup-plugin-obfuscator: v1.1.0
javascript-obfuscator: v4.1.0
Additional context
Add any other context about the problem here.
import { resolve, dirname } from "node:path";
import { fileURLToPath } from "node:url";
import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
import webExtension from "@samrum/vite-plugin-web-extension";
import manifest from "./src/manifest";
import AutoImport from "unplugin-auto-import/vite";
import Components from "unplugin-vue-components/vite";
import { NaiveUiResolver } from "unplugin-vue-components/resolvers";
import obfuscator from "rollup-plugin-obfuscator";
Describe the bug
If global is set to false, Identifier "createApp" has already been declared.
To Reproduce
1.global is set to false
2.build the project
3.Identifier "createApp" has already been declared
Stack trace
Package versions:
rollup-plugin-obfuscator
: v1.1.0javascript-obfuscator
: v4.1.0Additional context
Add any other context about the problem here.
import { resolve, dirname } from "node:path";
import { fileURLToPath } from "node:url";
import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
import webExtension from "@samrum/vite-plugin-web-extension";
import manifest from "./src/manifest";
import AutoImport from "unplugin-auto-import/vite";
import Components from "unplugin-vue-components/vite";
import { NaiveUiResolver } from "unplugin-vue-components/resolvers";
import obfuscator from "rollup-plugin-obfuscator";
const __dirname = dirname(fileURLToPath(import.meta.url));
// https://vitejs.dev/config/
export default defineConfig({
build: {
minify: "esbuild", // 默认
},
// esbuild: {
// drop: ["console", "debugger"], //打包去除
// },
resolve: {
alias: {
"@": resolve(__dirname, "src"),
},
},
server: {
port: 9999,
},
plugins: [
vue(),
webExtension({
manifest: {
...manifest,
},
}),
AutoImport({
dts: "src/auto-imports.d.ts",
imports: [
"vue",
{
"naive-ui": [
"useDialog",
"useMessage",
"useNotification",
"useLoadingBar",
],
},
"@vueuse/core",
],
}),
Components({
resolvers: [NaiveUiResolver()],
}),
obfuscator({
global: false,
// options配置项实际为 javascript-obfuscator 选项,具体可查看https://github.com/javascript-obfuscator/javascript-obfuscator
options: {
compact: true,
controlFlowFlattening: true,
controlFlowFlatteningThreshold: 0.75,
numbersToExpressions: true,
simplify: true,
stringArrayShuffle: true,
splitStrings: true,
splitStringsChunkLength: 10,
rotateUnicodeArray: true,
deadCodeInjection: true,
deadCodeInjectionThreshold: 0.4,
debugProtection: false,
debugProtectionInterval: 2000,
disableConsoleOutput: true,
domainLock: [],
identifierNamesGenerator: "hexadecimal",
identifiersPrefix: "",
inputFileName: "",
log: true,
renameGlobals: true,
reservedNames: [],
reservedStrings: [],
seed: 0,
selfDefending: true,
sourceMap: false,
sourceMapBaseUrl: "",
sourceMapFileName: "",
sourceMapMode: "separate",
stringArray: true,
stringArrayEncoding: ["base64"],
stringArrayThreshold: 0.75,
target: "browser",
transformObjectKeys: true,
unicodeEscapeSequence: true,
domainLockRedirectUrl: "about:blank",
forceTransformStrings: [],
identifierNamesCache: null,
identifiersDictionary: [],
ignoreImports: true,
optionsPreset: "default",
renameProperties: false,
renamePropertiesMode: "safe",
sourceMapSourcesMode: "sources-content",
],
});
The text was updated successfully, but these errors were encountered: