From 89fe63a4cf8fa89d8dff41fc882973072e4e425f Mon Sep 17 00:00:00 2001 From: Oc1S Date: Thu, 27 Jun 2024 23:01:16 +0800 Subject: [PATCH] chore: sort import --- chrome-extension/vite.config.ts | 7 ++++--- packages/dev-utils/lib/manifest-parser/impl.ts | 2 +- packages/hmr/lib/initReloadServer.ts | 3 ++- packages/hmr/lib/plugins/make-entry-point-plugin.ts | 1 - packages/hmr/lib/plugins/watch-rebuild-plugin.ts | 7 ++++--- pages/popup/vite.config.ts | 4 ++-- 6 files changed, 13 insertions(+), 11 deletions(-) diff --git a/chrome-extension/vite.config.ts b/chrome-extension/vite.config.ts index 41c0bd5..105a354 100644 --- a/chrome-extension/vite.config.ts +++ b/chrome-extension/vite.config.ts @@ -1,8 +1,9 @@ -import { defineConfig } from 'vite'; -import { resolve } from 'path'; +import { watchRebuildPlugin } from '@ehentai-helper/hmr'; import libAssetsPlugin from '@laynezh/vite-plugin-lib-assets'; +import { resolve } from 'path'; +import { defineConfig } from 'vite'; + import makeManifestPlugin from './utils/plugins/make-manifest-plugin'; -import { watchRebuildPlugin } from '@ehentai-helper/hmr'; const rootDir = resolve(__dirname); const libDir = resolve(rootDir, 'lib'); diff --git a/packages/dev-utils/lib/manifest-parser/impl.ts b/packages/dev-utils/lib/manifest-parser/impl.ts index 39046a5..bd24302 100644 --- a/packages/dev-utils/lib/manifest-parser/impl.ts +++ b/packages/dev-utils/lib/manifest-parser/impl.ts @@ -1,4 +1,4 @@ -import { ManifestParserInterface, Manifest } from './type'; +import { Manifest, ManifestParserInterface } from './type'; export const ManifestParserImpl: ManifestParserInterface = { convertManifestToString: (manifest, env) => { diff --git a/packages/hmr/lib/initReloadServer.ts b/packages/hmr/lib/initReloadServer.ts index e61081e..a08c955 100644 --- a/packages/hmr/lib/initReloadServer.ts +++ b/packages/hmr/lib/initReloadServer.ts @@ -1,6 +1,7 @@ #!/usr/bin/env node import { WebSocket, WebSocketServer } from 'ws'; + import { LOCAL_RELOAD_SOCKET_PORT, LOCAL_RELOAD_SOCKET_URL } from './constant'; import MessageInterpreter from './interpreter'; @@ -26,7 +27,7 @@ function initReloadServer() { } if (message.type === 'build_complete') { clientsThatNeedToUpdate.forEach((ws: WebSocket) => - ws.send(MessageInterpreter.send({ type: 'do_update', id: message.id })), + ws.send(MessageInterpreter.send({ type: 'do_update', id: message.id })) ); } }); diff --git a/packages/hmr/lib/plugins/make-entry-point-plugin.ts b/packages/hmr/lib/plugins/make-entry-point-plugin.ts index 989c838..24bf90d 100644 --- a/packages/hmr/lib/plugins/make-entry-point-plugin.ts +++ b/packages/hmr/lib/plugins/make-entry-point-plugin.ts @@ -27,7 +27,6 @@ export function makeEntryPointPlugin(): PluginOption { const replacedSource = String(module.source).replaceAll(originalFileName, newFileName); module.source = ''; fs.writeFileSync(path.resolve(outputDir, newFileName), replacedSource); - break; } break; case 'chunk': { diff --git a/packages/hmr/lib/plugins/watch-rebuild-plugin.ts b/packages/hmr/lib/plugins/watch-rebuild-plugin.ts index 9e113c3..fda4c99 100644 --- a/packages/hmr/lib/plugins/watch-rebuild-plugin.ts +++ b/packages/hmr/lib/plugins/watch-rebuild-plugin.ts @@ -1,9 +1,10 @@ +import * as fs from 'fs'; +import path from 'path'; import type { PluginOption } from 'vite'; import { WebSocket } from 'ws'; -import MessageInterpreter from '../interpreter'; + import { LOCAL_RELOAD_SOCKET_URL } from '../constant'; -import * as fs from 'fs'; -import path from 'path'; +import MessageInterpreter from '../interpreter'; type PluginConfig = { onStart?: () => void; diff --git a/pages/popup/vite.config.ts b/pages/popup/vite.config.ts index 9dc5eb5..f64f60c 100644 --- a/pages/popup/vite.config.ts +++ b/pages/popup/vite.config.ts @@ -1,7 +1,7 @@ -import { defineConfig } from 'vite'; +import { watchRebuildPlugin } from '@ehentai-helper/hmr'; import react from '@vitejs/plugin-react-swc'; import { resolve } from 'path'; -import { watchRebuildPlugin } from '@ehentai-helper/hmr'; +import { defineConfig } from 'vite'; const rootDir = resolve(__dirname); const srcDir = resolve(rootDir, 'src');