From 4c016e2693c44fb29ac8d15676cd880ca9a77abd Mon Sep 17 00:00:00 2001 From: xion Date: Tue, 26 Nov 2024 12:20:14 +0800 Subject: [PATCH] fix: use module css in message module --- apps/ui/.npmrc | 3 + apps/ui/config/rollup.components.config.js | 29 +++- apps/ui/package.json | 7 +- apps/ui/rollup.config.js | 17 ++- apps/ui/src/components/message/message.css | 158 +++++++++++++++++++++ apps/ui/src/components/message/message.ts | 10 +- apps/ui/src/components/modal/modal.ts | 2 + apps/ui/tsconfig.json | 5 +- apps/ui/typings.d.ts | 4 + pnpm-lock.yaml | 48 +++++++ 10 files changed, 270 insertions(+), 13 deletions(-) create mode 100644 apps/ui/.npmrc create mode 100644 apps/ui/src/components/message/message.css create mode 100644 apps/ui/typings.d.ts diff --git a/apps/ui/.npmrc b/apps/ui/.npmrc new file mode 100644 index 0000000..a4d9caf --- /dev/null +++ b/apps/ui/.npmrc @@ -0,0 +1,3 @@ +//npm.xiongxiao.me/:_authToken=${ME_NPM_TOKEN} +@abearxiong:registry=https://npm.pkg.github.com +//registry.npmjs.org/:_authToken=${NPM_TOKEN} \ No newline at end of file diff --git a/apps/ui/config/rollup.components.config.js b/apps/ui/config/rollup.components.config.js index 7517931..e024132 100644 --- a/apps/ui/config/rollup.components.config.js +++ b/apps/ui/config/rollup.components.config.js @@ -5,11 +5,12 @@ import postcss from 'rollup-plugin-postcss'; import autoprefixer from 'autoprefixer'; import cssnano from 'cssnano'; import terser from '@rollup/plugin-terser'; - import postcssImport from 'postcss-import'; +import postcssNesting from 'postcss-nesting'; + import dts from 'rollup-plugin-dts'; -import * as glob from 'glob'; +import glob from 'fast-glob'; import path from 'path'; const isApps = process.env.TYPE === 'apps'; const components = glob.sync('./src/components/**/index.ts'); @@ -38,6 +39,19 @@ const configs = entrys browser: true, // 处理浏览器版本的依赖 }), commonjs(), + postcss({ + inject: true, // 将 CSS 作为