Closed soulwu closed 3 weeks ago
You can modify the plugins
in builderConfig
. The built-in plugins for less and sass will be removed in Rspress 2.0 in the future.
You can modify the
plugins
inbuilderConfig
. The built-in plugins for less and sass will be removed in Rspress 2.0 in the future.
https://codesandbox.io/p/devbox/bold-cdn-wpryxf?file=%2Fpackage.json%3A18%2C1
I modify the plugins, but not take effect at all. I hope the .math
class can be width: 1px
Rsbuild may can not modify plugins funtionally like raw
or tools.rspack
to remove the less plugins built-in and config new less plugins with some options.
You can config via builderConfig.tools.rspack
to modify rspack config directly.
Any other good idea? @chenjiahan
@Timeless0911 Rspress can check if user is configuring the Less/Sass plugin via builderPlugins
or builderConfig.plugins
. If configured, Rspress should not register these plugins again.
版本信息
问题详情
rsbuild 从 0.7.0 版本开始不再内置 less-loader,改为使用 plugin 方式。rspress 新版本也跟进了这一改动,但是新的方式不再支持用户自定义配置 lessOptions。由于 rspress 内部默认加载了 @rsbuild/plugin-less,因此用户也无法自行加载该插件
复现链接
无
复现步骤
无法配置 lessOptions,比如 lessOptions: { javascriptEnabled: true, math: 'always' }