Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions packages/sui-bundler/loaders/linkLoaderConfigBuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,20 @@ module.exports = ({config, packagesToLink, linkAll}) => {

if (!regex.test('.css')) return rule

if (!Array.isArray(use)) return rule

/**
* Only rules that already pipe through @s-ui/sass-loader need its importer
* replaced. Rules that don't (like the plainCssPackages passthrough) must be
* left untouched: injecting the sass loader there makes Sass parse plain CSS
* that isn't valid SCSS (e.g. Tailwind v4 output) and the build fails.
*/
const usesSassLoader = use.some(loaderEntry =>
(typeof loaderEntry === 'string' ? loaderEntry : loaderEntry?.loader || '').includes('@s-ui/sass-loader')
)

if (!usesSassLoader) return rule

return {
...rule,
use: [...use.slice(0, -1), sassLoaderWithLinkImporter]
Expand Down
Loading