fix: rename sub-store.bundle.js to .cjs for ES module compatibility

* fix: rename sub-store.bundle.js to .cjs for ES module compatibility

* Update changelog.md
This commit is contained in:
Memory 2025-08-23 20:32:35 +08:00 committed by GitHub
parent 3c57f7d99b
commit 941831728c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 6 additions and 5 deletions

View File

@ -13,6 +13,7 @@
- 修复 轻量模式延迟启动延时输入数值问题(#962) - 修复 轻量模式延迟启动延时输入数值问题(#962)
- 修复 轻量模式下轻量模式下规则失效的问题(#963) - 修复 轻量模式下轻量模式下规则失效的问题(#963)
- 修复 MacOS 下默认虚拟网卡名称没有生效的问题 - 修复 MacOS 下默认虚拟网卡名称没有生效的问题
- 修复 ES Module 兼容性问题
### 样式调整 (Sytle) ### 样式调整 (Sytle)
- 部分样式微调 - 部分样式微调

View File

@ -351,7 +351,7 @@ const resolve7zip = () =>
}) })
const resolveSubstore = () => const resolveSubstore = () =>
resolveResource({ resolveResource({
file: 'sub-store.bundle.js', file: 'sub-store.bundle.cjs',
downloadURL: downloadURL:
'https://github.com/sub-store-org/Sub-Store/releases/latest/download/sub-store.bundle.js' 'https://github.com/sub-store-org/Sub-Store/releases/latest/download/sub-store.bundle.js'
}) })

View File

@ -119,7 +119,7 @@ export async function startSubStoreBackendServer(): Promise<void> {
SUB_STORE_MMDB_COUNTRY_PATH: path.join(mihomoWorkDir(), 'country.mmdb'), SUB_STORE_MMDB_COUNTRY_PATH: path.join(mihomoWorkDir(), 'country.mmdb'),
SUB_STORE_MMDB_ASN_PATH: path.join(mihomoWorkDir(), 'ASN.mmdb') SUB_STORE_MMDB_ASN_PATH: path.join(mihomoWorkDir(), 'ASN.mmdb')
} }
subStoreBackendWorker = new Worker(path.join(mihomoWorkDir(), 'sub-store.bundle.js'), { subStoreBackendWorker = new Worker(path.join(mihomoWorkDir(), 'sub-store.bundle.cjs'), {
env: useProxyInSubStore env: useProxyInSubStore
? { ? {
...env, ...env,
@ -143,7 +143,7 @@ export async function stopSubStoreBackendServer(): Promise<void> {
export async function downloadSubStore(): Promise<void> { export async function downloadSubStore(): Promise<void> {
const { 'mixed-port': mixedPort = 7890 } = await getControledMihomoConfig() const { 'mixed-port': mixedPort = 7890 } = await getControledMihomoConfig()
const frontendDir = path.join(mihomoWorkDir(), 'sub-store-frontend') const frontendDir = path.join(mihomoWorkDir(), 'sub-store-frontend')
const backendPath = path.join(mihomoWorkDir(), 'sub-store.bundle.js') const backendPath = path.join(mihomoWorkDir(), 'sub-store.bundle.cjs')
const tempDir = path.join(dataDir(), 'temp') const tempDir = path.join(dataDir(), 'temp')
try { try {
@ -154,7 +154,7 @@ export async function downloadSubStore(): Promise<void> {
mkdirSync(tempDir, { recursive: true }) mkdirSync(tempDir, { recursive: true })
// 下载后端文件 // 下载后端文件
const tempBackendPath = path.join(tempDir, 'sub-store.bundle.js') const tempBackendPath = path.join(tempDir, 'sub-store.bundle.cjs')
const backendRes = await axios.get( const backendRes = await axios.get(
'https://github.com/sub-store-org/Sub-Store/releases/latest/download/sub-store.bundle.js', 'https://github.com/sub-store-org/Sub-Store/releases/latest/download/sub-store.bundle.js',
{ {

View File

@ -185,7 +185,7 @@ async function initFiles(): Promise<void> {
copy('geoip.dat'), copy('geoip.dat'),
copy('geosite.dat'), copy('geosite.dat'),
copy('ASN.mmdb'), copy('ASN.mmdb'),
copy('sub-store.bundle.js'), copy('sub-store.bundle.cjs'),
copy('sub-store-frontend') copy('sub-store-frontend')
]) ])
} }