(
dir,
bannerLabel,
{ tailwind = false, primitives = false } = {},
)
| 214 | } |
| 215 | |
| 216 | export async function buildPlugin( |
| 217 | dir, |
| 218 | bannerLabel, |
| 219 | { tailwind = false, primitives = false } = {}, |
| 220 | ) { |
| 221 | await runRsbuildConfig(createPluginBuildConfig(dir)); |
| 222 | if (bannerLabel) { |
| 223 | const distJs = path.join(dashboardRoot, dir, "dist/index.js"); |
| 224 | const js = await fs.readFile(distJs, "utf8"); |
| 225 | await fs.writeFile(distJs, `${pluginBannerComment(bannerLabel)}\n${js}`, "utf8"); |
| 226 | } |
| 227 | const distCss = path.join(dashboardRoot, dir, "dist/style.css"); |
| 228 | await fs.mkdir(path.dirname(distCss), { recursive: true }); |
| 229 | if (tailwind) { |
| 230 | await compileTailwindCss(path.join(dashboardRoot, dir, "src"), distCss); |
| 231 | } else { |
| 232 | await fs.copyFile(path.join(dashboardRoot, dir, "src/styles.css"), distCss); |
| 233 | } |
| 234 | if (primitives) { |
| 235 | const [prim, plugin] = await Promise.all([ |
| 236 | fs.readFile(path.join(dashboardRoot, "lib/primitives.css"), "utf8"), |
| 237 | fs.readFile(distCss, "utf8"), |
| 238 | ]); |
| 239 | await fs.writeFile(distCss, `${prim}\n${plugin}`, "utf8"); |
| 240 | } |
| 241 | } |
| 242 | |
| 243 | export async function buildHolographicPlugin() { |
| 244 | await buildPlugin("holographic", "holographic-memory", { |
no test coverage detected