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 772bc41

Browse files
committed
feat(webpack5-react): merge plugin-sass
1 parent ae43067 commit 772bc41

File tree

2 files changed

+24
-4
lines changed

2 files changed

+24
-4
lines changed

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@alicloud/console-toolkit-plugin-webpack5-react",
3-
"version": "1.1.9",
3+
"version": "1.2.0",
44
"description": "console toolkit plugin for base react app",
55
"main": "lib/index.js",
66
"scripts": {
@@ -42,14 +42,15 @@
4242
"@gem-mine/webpack-chain": "^7.0.0",
4343
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.1",
4444
"assert": "^1.4.1",
45-
"autoprefixer": "^9.6.0",
45+
"autoprefixer": "^10.0.0",
4646
"babel-loader": "^8.0.5",
4747
"cheerio": "^1.0.0-rc.3",
4848
"core-js": "^3.37.1",
4949
"css-loader": "^6.0.0",
5050
"css-minimizer-webpack-plugin": "^6.0.0",
5151
"error-overlay-webpack-plugin": "^1.0.0",
5252
"es5-imcompatible-versions": "^0.1.62",
53+
"fast-sass-loader": "^2.0.1",
5354
"file-loader": "^6.2.0",
5455
"fs-extra": "^11.1.1",
5556
"html-webpack-plugin": "^5.0.0",
@@ -58,8 +59,8 @@
5859
"lodash": "^4.17.11",
5960
"mini-css-extract-plugin": "^2.6.1",
6061
"pkg-up": "^3.1.0",
61-
"postcss-less": "^6.0.0",
6262
"postcss-loader": "^8.0.1",
63+
"sass": "^1.67.0",
6364
"semver": "^7.3.2",
6465
"simple-progress-webpack-plugin": "^1.1.2",
6566
"style-loader": "^3.0.0",

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

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import * as path from 'path';
12
import * as autoprefixer from 'autoprefixer';
23
import * as Chain from '@gem-mine/webpack-chain';
34
import * as webpack from 'webpack';
@@ -132,10 +133,16 @@ export const style = (config: Chain, options: BreezrStyleOptions) => {
132133
const lessLoaderOptions = {
133134
lessOptions: {
134135
javascriptEnabled: true,
135-
modifyVars: options.theme ? normalizeTheme(options.theme, {cwd}) : {}
136+
modifyVars: options.theme ? normalizeTheme(options.theme, {cwd}) : {}
136137
}
137138
};
138139

140+
const sassLoaderOptions = {
141+
includePaths: [
142+
path.resolve(cwd, 'node_modules')
143+
],
144+
};
145+
139146
createCssRules('css', { test: /\.css$/ });
140147

141148
/*
@@ -164,6 +171,18 @@ export const style = (config: Chain, options: BreezrStyleOptions) => {
164171
modules: true,
165172
});
166173

174+
// .sass
175+
createCssRules('sass', { test: /\.sass$/ }, {
176+
loader: 'fast-sass-loader',
177+
loaderOptions: sassLoaderOptions,
178+
});
179+
180+
// .scss
181+
createCssRules('scss', { test: /\.scss$/ }, {
182+
loader: 'fast-sass-loader',
183+
loaderOptions: sassLoaderOptions,
184+
});
185+
167186
if (shouldExtract) {
168187
// NOTE there 'extract-css' used by breezr-plugin-long-term-caching
169188
config.plugin('extract-css')

0 commit comments

Comments
(0)

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