diff --git a/apps/backend-mock/nitro.config.ts b/apps/backend-mock/nitro.config.ts index b3013298d..c2d7297fb 100644 --- a/apps/backend-mock/nitro.config.ts +++ b/apps/backend-mock/nitro.config.ts @@ -1,5 +1,6 @@ import errorHandler from './error'; +process.env.COMPATIBILITY_DATE = new Date().toISOString(); export default defineNitroConfig({ devErrorHandler: errorHandler, errorHandler: '~/error', diff --git a/internal/vite-config/package.json b/internal/vite-config/package.json index 18250107b..5189cec4d 100644 --- a/internal/vite-config/package.json +++ b/internal/vite-config/package.json @@ -35,7 +35,6 @@ "html-minifier-terser": "catalog:", "nitropack": "catalog:", "resolve.exports": "catalog:", - "vite-plugin-lib-inject-css": "catalog:", "vite-plugin-pwa": "catalog:", "vite-plugin-vue-devtools": "catalog:" }, diff --git a/internal/vite-config/src/config/library.ts b/internal/vite-config/src/config/library.ts index 759fc7bc3..08b813520 100644 --- a/internal/vite-config/src/config/library.ts +++ b/internal/vite-config/src/config/library.ts @@ -19,7 +19,6 @@ function defineLibraryConfig(userConfigPromise?: DefineLibraryOptions) { const plugins = await loadLibraryPlugins({ dts: false, - injectLibCss: true, injectMetadata: true, isBuild, mode, diff --git a/internal/vite-config/src/plugins/index.ts b/internal/vite-config/src/plugins/index.ts index 1a8e7c263..691d32249 100644 --- a/internal/vite-config/src/plugins/index.ts +++ b/internal/vite-config/src/plugins/index.ts @@ -14,7 +14,6 @@ import { visualizer as viteVisualizerPlugin } from 'rollup-plugin-visualizer'; import viteCompressPlugin from 'vite-plugin-compression'; import viteDtsPlugin from 'vite-plugin-dts'; import { createHtmlPlugin as viteHtmlPlugin } from 'vite-plugin-html'; -import { libInjectCss as viteLibInjectCss } from 'vite-plugin-lib-inject-css'; import { VitePWA } from 'vite-plugin-pwa'; import viteVueDevTools from 'vite-plugin-vue-devtools'; @@ -225,7 +224,7 @@ async function loadLibraryPlugins( ): Promise { // 单独取,否则commonOptions拿不到 const isBuild = options.isBuild; - const { dts, injectLibCss, ...commonOptions } = options; + const { dts, ...commonOptions } = options; const commonPlugins = await loadCommonPlugins(commonOptions); return await loadConditionPlugins([ ...commonPlugins, @@ -233,10 +232,6 @@ async function loadLibraryPlugins( condition: isBuild && !!dts, plugins: () => [viteDtsPlugin({ logLevel: 'error' })], }, - { - condition: injectLibCss, - plugins: () => [viteLibInjectCss()], - }, ]); } diff --git a/internal/vite-config/src/typing.ts b/internal/vite-config/src/typing.ts index 907a723e4..31683cc75 100644 --- a/internal/vite-config/src/typing.ts +++ b/internal/vite-config/src/typing.ts @@ -130,9 +130,6 @@ interface ApplicationPluginOptions extends CommonPluginOptions { interface LibraryPluginOptions extends CommonPluginOptions { /** 开启 dts 输出 */ dts?: boolean | PluginOptions; - - /** 是否注入lib css */ - injectLibCss?: boolean; } type ApplicationOptions = ApplicationPluginOptions; diff --git a/packages/@core/base/design/package.json b/packages/@core/base/design/package.json index 54495aba4..e93ab1e4e 100644 --- a/packages/@core/base/design/package.json +++ b/packages/@core/base/design/package.json @@ -28,7 +28,7 @@ ".": { "types": "./src/index.ts", "development": "./src/index.ts", - "default": "./dist/index.mjs" + "default": "./dist/style.css" } }, "publishConfig": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 662bf3115..199d19357 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -438,9 +438,6 @@ catalogs: vite-plugin-lazy-import: specifier: ^1.0.7 version: 1.0.7 - vite-plugin-lib-inject-css: - specifier: ^2.1.1 - version: 2.1.1 vite-plugin-pwa: specifier: ^0.20.5 version: 0.20.5 @@ -1116,9 +1113,6 @@ importers: resolve.exports: specifier: 'catalog:' version: 2.0.2 - vite-plugin-lib-inject-css: - specifier: 'catalog:' - version: 2.1.1(vite@5.4.10(@types/node@22.8.6)(less@4.2.0)(sass@1.79.5)(terser@5.36.0)) vite-plugin-pwa: specifier: 'catalog:' version: 0.20.5(vite@5.4.10(@types/node@22.8.6)(less@4.2.0)(sass@1.79.5)(terser@5.36.0))(workbox-build@7.3.0)(workbox-window@7.3.0) @@ -9913,11 +9907,6 @@ packages: vite-plugin-lazy-import@1.0.7: resolution: {integrity: sha512-mE6oAObOb4wqso4AoUGi9cLjdR+4vay1RCaKJvziBuFPlziZl7J0aw2hsqRTokLVRx3bli0a0VyjMOwsNDv58A==} - vite-plugin-lib-inject-css@2.1.1: - resolution: {integrity: sha512-RIMeVnqBK/8I0E9nnQWzws6pdj5ilRMPJSnXYb6nWxNR4EmDPnksnb/ACoR5Fy7QfzULqS4gtQMrjwnNCC9zoA==} - peerDependencies: - vite: '*' - vite-plugin-pwa@0.20.5: resolution: {integrity: sha512-aweuI/6G6n4C5Inn0vwHumElU/UEpNuO+9iZzwPZGTCH87TeZ6YFMrEY6ZUBQdIHHlhTsbMDryFARcSuOdsz9Q==} engines: {node: '>=16.0.0'} @@ -19416,13 +19405,6 @@ snapshots: rollup: 4.24.3 xe-utils: 3.5.31 - vite-plugin-lib-inject-css@2.1.1(vite@5.4.10(@types/node@22.8.6)(less@4.2.0)(sass@1.79.5)(terser@5.36.0)): - dependencies: - '@ast-grep/napi': 0.29.0 - magic-string: 0.30.12 - picocolors: 1.1.1 - vite: 5.4.10(@types/node@22.8.6)(less@4.2.0)(sass@1.79.5)(terser@5.36.0) - vite-plugin-pwa@0.20.5(vite@5.4.10(@types/node@22.8.6)(less@4.2.0)(sass@1.79.5)(terser@5.36.0))(workbox-build@7.3.0)(workbox-window@7.3.0): dependencies: debug: 4.3.7(supports-color@9.4.0) diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index bab6f36ad..f771186aa 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -162,7 +162,6 @@ catalog: vite-plugin-dts: 4.2.1 vite-plugin-html: ^3.2.2 vite-plugin-lazy-import: ^1.0.7 - vite-plugin-lib-inject-css: ^2.1.1 vite-plugin-pwa: ^0.20.5 vite-plugin-vue-devtools: ^7.6.2 vitepress: ^1.4.3