diff --git a/esbuild.config.mjs b/esbuild.config.mjs index 34a9033..3931abe 100644 --- a/esbuild.config.mjs +++ b/esbuild.config.mjs @@ -20,6 +20,9 @@ esbuild }, entryPoints: ['src/main.ts'], bundle: true, + define: { + 'process.env.NODE_ENV': prod ? '"production"' : '"development"', // 显式设置环境变量为生产模式 + }, external: [ 'obsidian', 'electron', diff --git a/manifest.json b/manifest.json index b67d892..359497e 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "id": "mdfriday", "name": "Friday", - "version": "0.1.2", + "version": "0.1.3", "minAppVersion": "0.15.0", "description": "Notes to Website. Friday helps you turn Markdown documents into websites in minutes.", "author": "sunwei", diff --git a/package.json b/package.json index 784f338..dd35975 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "obsidian-friday-plugin", - "version": "0.1.2", + "version": "0.1.3", "description": "Friday is an Obsidian plugin that empowers users to focus on content creation by writing Markdown files, while we handle the distribution. From creating websites to content deployment, Friday serves as a creative output assistant, helping users turn their work into publishable sites with ease.", "main": "main.js", "scripts": { diff --git a/src/main.ts b/src/main.ts index cbc2986..3e3951d 100644 --- a/src/main.ts +++ b/src/main.ts @@ -46,7 +46,8 @@ export default class FridayPlugin extends Plugin { async initFriday(): Promise { this.fileInfo = new FileInfo() - this.apiUrl = process.env.NODE_ENV === 'production' ? API_URL_PRO : API_URL_DEV; + this.apiUrl = process.env.NODE_ENV === 'development' ? API_URL_DEV : API_URL_PRO; + this.user = new User(this); await this.user.initializeUser() diff --git a/versions.json b/versions.json index ff0516b..8213519 100644 --- a/versions.json +++ b/versions.json @@ -1,4 +1,3 @@ { - "0.1.1": "0.15.0", - "0.1.2": "0.15.0" -} \ No newline at end of file + "0.1.3": "0.15.0" +}