From 03ecc379f9f4d5bd64eea60bad88083478b1a5c1 Mon Sep 17 00:00:00 2001 From: Jonson Petard Date: Wed, 3 Apr 2024 05:48:50 +0800 Subject: [PATCH] chore: rm global scss dts --- .../base/base-dialog.module.scss.d.ts | 3 +-- src/main.tsx | 3 ++- src/pages/_app.module.scss.d.ts | 3 +-- src/style.d.ts | 22 ------------------- vite.config.ts | 11 +--------- 5 files changed, 5 insertions(+), 37 deletions(-) delete mode 100644 src/style.d.ts diff --git a/src/components/base/base-dialog.module.scss.d.ts b/src/components/base/base-dialog.module.scss.d.ts index 9e98a25429..384e818d17 100644 --- a/src/components/base/base-dialog.module.scss.d.ts +++ b/src/components/base/base-dialog.module.scss.d.ts @@ -1,5 +1,4 @@ -import globalClassNames from "../../style.d"; -declare const classNames: typeof globalClassNames & { +declare const classNames: { readonly basePageTransition: "basePageTransition"; readonly "MuiDialog-paper": "MuiDialog-paper"; }; diff --git a/src/main.tsx b/src/main.tsx index 769f917783..7c2ad8e4dd 100644 --- a/src/main.tsx +++ b/src/main.tsx @@ -1,14 +1,15 @@ /// /// +import "./assets/styles/index.scss"; import { ResizeObserver } from "@juggle/resize-observer"; if (!window.ResizeObserver) { window.ResizeObserver = ResizeObserver; } -import { Routes } from "@generouted/react-router/lazy"; import React from "react"; import { createRoot } from "react-dom/client"; +import { Routes } from "@generouted/react-router/lazy"; import { RecoilRoot } from "recoil"; import "./services/i18n"; const container = document.getElementById("root")!; diff --git a/src/pages/_app.module.scss.d.ts b/src/pages/_app.module.scss.d.ts index 3ca6335e04..938feafd72 100644 --- a/src/pages/_app.module.scss.d.ts +++ b/src/pages/_app.module.scss.d.ts @@ -1,5 +1,4 @@ -import globalClassNames from "../style.d"; -declare const classNames: typeof globalClassNames & { +declare const classNames: { readonly oops: "oops"; readonly dark: "dark"; }; diff --git a/src/style.d.ts b/src/style.d.ts deleted file mode 100644 index 8e40a1529d..0000000000 --- a/src/style.d.ts +++ /dev/null @@ -1,22 +0,0 @@ -declare const classNames: { - readonly layout: "layout"; - readonly layout__left: "layout__left"; - readonly "the-logo": "the-logo"; - readonly "the-newbtn": "the-newbtn"; - readonly "the-menu": "the-menu"; - readonly "the-traffic": "the-traffic"; - readonly layout__right: "layout__right"; - readonly "the-bar": "the-bar"; - readonly "the-content": "the-content"; - readonly "drag-mask": "drag-mask"; - readonly linux: "linux"; - readonly windows: "windows"; - readonly unknown: "unknown"; - readonly macos: "macos"; - readonly "base-page": "base-page"; - readonly "base-container": "base-container"; - readonly "base-content": "base-content"; - readonly "no-padding": "no-padding"; - readonly "user-none": "user-none"; -}; -export = classNames; diff --git a/vite.config.ts b/vite.config.ts index cac8202c58..25fd8ddb2f 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -17,7 +17,6 @@ export default defineConfig(({ command }) => { css: { preprocessorOptions: { scss: { - additionalData: `@use "@/styles" as common;`, importer(...args) { if (args[0] !== "@/styles") { return; @@ -35,15 +34,7 @@ export default defineConfig(({ command }) => { svgr(), react(), generouted(), - sassDts({ - enabledMode: ["development", "production"], - global: { - generate: true, - outputFilePath: path.resolve(__dirname, "./src/style.d.ts"), - }, - sourceDir: path.resolve(__dirname, "./src"), - outputDir: path.resolve(__dirname, "./dist"), - }), + sassDts(), monaco({ languageWorkers: ["editorWorkerService", "typescript"] }), ], esbuild: {