Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Aug 5, 2025. It is now read-only.

Commit 7733d56

Browse files
committed
chore
1 parent 29a06f5 commit 7733d56

File tree

4 files changed

+19
-11
lines changed

4 files changed

+19
-11
lines changed

‎packages/plugin-webpack5-react/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@alicloud/console-toolkit-plugin-webpack5-react",
3-
"version": "1.2.0",
3+
"version": "1.2.1",
44
"description": "console toolkit plugin for base react app",
55
"main": "lib/index.js",
66
"scripts": {

‎packages/plugin-webpack5-react/src/types/index.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ interface BreezrReactOptions {
3535
disableAutoPrefixer?: boolean;
3636
postCssPlugins?: any[];
3737
disableImportXConsoleCSS?: boolean;
38+
useSass?: boolean;
3839

3940
// babel-loader 配置
4041
babel?: Function;
@@ -158,6 +159,7 @@ interface BreezrStyleOptions extends Pick<BreezrReactOptions, 'appId' | 'console
158159
disableAutoPrefixer?: boolean;
159160
condition?: CssConditionType;
160161
postCssPlugins?: any[];
162+
useSass?: boolean;
161163
}
162164

163165
interface ThemeDef {

‎packages/plugin-webpack5-react/src/webpack/common.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ export const common = (config: Chain, options: BreezrReactOptions = defaultOptio
8787
disableConsoleOS,
8888
appId,
8989
mf,
90+
useSass,
9091
} = options;
9192

9293
if (!cwd) {
@@ -169,6 +170,7 @@ export const common = (config: Chain, options: BreezrReactOptions = defaultOptio
169170
consoleOS,
170171
disableConsoleOS,
171172
appId,
173+
useSass
172174
});
173175

174176
file(config, options);

‎packages/plugin-webpack5-react/src/webpack/rules/style/index.ts

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ export const style = (config: Chain, options: BreezrStyleOptions) => {
110110
condition = 'stable',
111111
consoleOS,
112112
disableConsoleOS,
113+
useSass
113114
} = options;
114115

115116
const {
@@ -171,17 +172,20 @@ export const style = (config: Chain, options: BreezrStyleOptions) => {
171172
modules: true,
172173
});
173174

174-
// .sass
175-
createCssRules('sass', { test: /\.sass$/ }, {
176-
loader: 'fast-sass-loader',
177-
loaderOptions: sassLoaderOptions,
178-
});
175+
// 为了保持和历史逻辑一致,必须在 useSass 开启后再处理
176+
if (useSass) {
177+
// .sass
178+
createCssRules('sass', { test: /\.sass$/ }, {
179+
loader: 'fast-sass-loader',
180+
loaderOptions: sassLoaderOptions,
181+
});
179182

180-
// .scss
181-
createCssRules('scss', { test: /\.scss$/ }, {
182-
loader: 'fast-sass-loader',
183-
loaderOptions: sassLoaderOptions,
184-
});
183+
// .scss
184+
createCssRules('scss', { test: /\.scss$/ }, {
185+
loader: 'fast-sass-loader',
186+
loaderOptions: sassLoaderOptions,
187+
});
188+
}
185189

186190
if (shouldExtract) {
187191
// NOTE there 'extract-css' used by breezr-plugin-long-term-caching

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /