Skip to content

Commit

Permalink
build: move utils to shared.js
Browse files Browse the repository at this point in the history
  • Loading branch information
josStorer committed Mar 12, 2023
1 parent 92eb565 commit 2c65549
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion build.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ async function runWebpack(isWithoutKatex, callback) {
import: './src/popup/index.jsx',
dependOn: 'shared',
},
shared: ['preact', 'webextension-polyfill', '@primer/octicons-react'],
shared: ['preact', 'webextension-polyfill', '@primer/octicons-react', './src/utils'],
},
output: {
filename: '[name].js',
Expand Down
2 changes: 1 addition & 1 deletion src/background/apis/chatgpt-web.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// web version

import { fetchSSE } from '../../utils'
import { fetchSSE } from '../../utils/fetch-sse'
import { isEmpty } from 'lodash-es'
import { chatgptWebModelKeys, Models } from '../../config'

Expand Down
3 changes: 2 additions & 1 deletion src/background/apis/openai-api.mjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
// api version

import { maxResponseTokenLength, Models } from '../../config'
import { fetchSSE, getConversationPairs } from '../../utils'
import { fetchSSE } from '../../utils/fetch-sse'
import { getConversationPairs } from '../../utils/get-conversation-pairs'
import { isEmpty } from 'lodash-es'

const chatgptPromptBase =
Expand Down
2 changes: 1 addition & 1 deletion src/background/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
gptApiModelKeys,
isUsingApiKey,
} from '../config'
import { isSafari } from '../utils'
import { isSafari } from '../utils/is-safari'

const KEY_ACCESS_TOKEN = 'accessToken'
const cache = new ExpiryMap(10 * 1000)
Expand Down

0 comments on commit 2c65549

Please sign in to comment.