feat(sui-bundler): add plainCssPackages config to bypass sass-loader#1988
Open
tomasmax wants to merge 1 commit into
Open
feat(sui-bundler): add plainCssPackages config to bypass sass-loader#1988tomasmax wants to merge 1 commit into
tomasmax wants to merge 1 commit into
Conversation
…s-loader Adds a new `plainCssPackages` option to `sui-bundler` config that allows projects to specify npm packages whose CSS files should skip the sass-loader pipeline entirely. Packages that ship pre-compiled CSS (e.g. Tailwind CSS v4 output) use modern CSS syntax (@layer, @Property, nested rules) that Dart Sass cannot parse. This causes `Error: expected ";"` at build time. Usage in package.json: ```json { "config": { "sui-bundler": { "plainCssPackages": ["@adv-mt/ui", "@adv-mt/theme"] } } } ``` CSS files from listed packages are processed only by css-loader (+ MiniCssExtractPlugin or style-loader), bypassing postcss-loader and sass-loader. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
kikoruiz
approved these changes
May 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a new
plainCssPackagesconfig option tosui-bundlerthat allows consumer apps to specify npm packages whose.cssfiles should be loaded with onlycss-loader(and the appropriate style/extract loader), completely bypassing@s-ui/sass-loaderandpostcss-loader.Problem
sui-bundlerroutes all.cssand.scssfiles through the full Sass + PostCSS pipeline — including third-party packages that ship pre-compiled Tailwind CSS v4 output. Dart Sass interprets valid CSS constructs (liketransition-property: transform, ...) as Sass spread syntax, causing fatal build errors:This blocks any consumer app from importing packages that emit modern CSS not compatible with the Sass parser (e.g.
@adv-mt/uiwhich uses Tailwind CSS v4).Solution
A new config key
plainCssPackagesunderconfig.sui-bundlerin the consumer'spackage.json:{ "config": { "sui-bundler": { "plainCssPackages": ["@adv-mt/ui", "@adv-mt/theme"] } } }When set, the bundler:
node_modules/<package>/.cssfiles from those packages, using justcss-loader(+MiniCssExtractPlugin.loaderorstyle-loaderdepending on the webpack config)Files changed
shared/module-rules-sass.jswebpack.config.client.dev.jssassRules(was duplicating inline rules)webpack.config.dev.jsplainCssPackagessupport withstyle-loader(SPA dev mode)webpack.config.prod.jssassRulesas arraywebpack.config.lib.jssassRulesas arrayUsage
Then
import '@adv-mt/ui/styles.css'works without Sass compilation errors.Test plan
@adv-mt/ui@2.3.0CSS into a test app with patched bundler → build passes (no Sass errors)npx sui-lint js— 0 errors)🤖 Generated with Claude Code