Skip to content

Commit

Permalink
modify: ENV production check
Browse files Browse the repository at this point in the history
  • Loading branch information
sunwei committed Nov 13, 2024
1 parent 0a4022f commit e6996c7
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 6 deletions.
3 changes: 3 additions & 0 deletions esbuild.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ esbuild
},
entryPoints: ['src/main.ts'],
bundle: true,
define: {
'process.env.NODE_ENV': prod ? '"production"' : '"development"', // 显式设置环境变量为生产模式
},
external: [
'obsidian',
'electron',
Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
3 changes: 2 additions & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ export default class FridayPlugin extends Plugin {

async initFriday(): Promise<void> {
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()

Expand Down
5 changes: 2 additions & 3 deletions versions.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
{
"0.1.1": "0.15.0",
"0.1.2": "0.15.0"
}
"0.1.3": "0.15.0"
}

0 comments on commit e6996c7

Please sign in to comment.