UNPKG

@plugin-light/project-config-pixui

Version:
67 lines (47 loc) 2.25 kB
# PixUI 项目基础配置 <p align="center"> <img src="https://img.shields.io/npm/dw/@plugin-light/project-config-pixui"> <img src="https://img.shields.io/npm/unpacked-size/@plugin-light/project-config-pixui"> <img src="https://img.shields.io/npm/v/@plugin-light/project-config-pixui"> <img src="https://img.shields.io/npm/l/@plugin-light/project-config-pixui"> <img src="https://img.shields.io/github/last-commit/novlan1/plugin-light"> <img src="https://img.shields.io/github/created-at/novlan1/plugin-light"> </p> PixUI 项目的 `webpack` 配置。 ## 1. 如何使用 安装 ```bash pnpm add @plugin-light/project-config-pixui -D ``` 在 `.pixiderc/webpack.js` 中添加如下设置: ```js const { getPixuiWebpackConfig } = require('@plugin-light/project-config-pixui'); module.exports = getPixuiWebpackConfig({ appSettingDir: __dirname, }); ``` ## 2. 类型及默认参数 ### 2.1. 参数 `getPixuiWebpackConfig` 接收一个对象作为参数。 | 属性 | 类型 | 说明 | 默认值 | | ---------------- | --------- | ---------------------------------------------- | ---------------------------------------------------- | | appSettingDir | `string` | `apps.json` 和 `appsettings.json` 文件所在目录 | - | | tsxLoaderExclude | `regexp` | `tsx` 相关 `loader` 排除路径 | `/node_modules\/(?!@tencent\/pmd\|@tencent\/press)/` | | port | `number` | 启动端口号 | `8080` | | useTailwind | `boolean` | 是否使用 tailwindcss | `false` | ### 2.2. 类名 `less` 文件中的类名采用 `modules` 方式。 ```ts { loader: require.resolve('css-loader'), options: { modules: { localIdentName: '[name]_[local]__[hash:base64:6]', }, }, } ``` ### 2.3. 关于 tailwindcss PixUI 不支持 CSS 变量,`tailwindcss` 使用严重受限,不建议在 PixUI 中使用 `tailwindcss`。 ## 3. 更新日志 [点此查看](./CHANGELOG.md)