PixUI 项目基础配置
PixUI 项目的 webpack 配置。
1. 作者
novlan1
2. 如何使用
安装
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,
});3. 类型及默认参数
3.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 |
3.2. 类名
less 文件中的类名采用 modules 方式。
ts
{
loader: require.resolve('css-loader'),
options: {
modules: {
localIdentName: '[name]_[local]__[hash:base64:6]',
},
},
}3.3. 关于 tailwindcss
PixUI 不支持 CSS 变量,tailwindcss 使用严重受限,不建议在 PixUI 中使用 tailwindcss。