Fix CSS extraction for consuming Vite projects #1

Merged
Copilot merged 5 commits from copilot/load-base-scss-automatically into main 2026-02-12 12:47:28 +00:00
Copilot commented 2026-02-12 11:36:04 +00:00 (Migrated from github.com)

base.scss styles were not appearing in the build CSS output of consuming projects. The prior fix used sassPlugin({ type: "style" }) which injects CSS at runtime via document.head.appendChild — invisible to Vite's CSS extraction pipeline.

  • tsup.config.ts: Reverted sassPlugin to default type ("css") to emit a proper dist/index.css, and added banner: { js: "import './index.css';" } so consuming bundlers discover and extract the CSS
  • package.json: Restored style field in top-level and exports map

Build output now contains a standalone index.css with the styles, and index.js opens with the CSS import:

import './index.css';
// ...rest of library

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

`base.scss` styles were not appearing in the build CSS output of consuming projects. The prior fix used `sassPlugin({ type: "style" })` which injects CSS at runtime via `document.head.appendChild` — invisible to Vite's CSS extraction pipeline. - **`tsup.config.ts`**: Reverted sassPlugin to default type (`"css"`) to emit a proper `dist/index.css`, and added `banner: { js: "import './index.css';" }` so consuming bundlers discover and extract the CSS - **`package.json`**: Restored `style` field in top-level and `exports` map Build output now contains a standalone `index.css` with the styles, and `index.js` opens with the CSS import: ```js import './index.css'; // ...rest of library ``` <!-- START COPILOT CODING AGENT TIPS --> --- 💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more [Copilot coding agent tips](https://gh.io/copilot-coding-agent-tips) in the docs.
Chocolateandmilkwin (Migrated from github.com) reviewed 2026-02-12 11:36:04 +00:00
Sign in to join this conversation.
No description provided.