File tree Expand file tree Collapse file tree 4 files changed +7
-19
lines changed Expand file tree Collapse file tree 4 files changed +7
-19
lines changed Original file line number Diff line number Diff line change @@ -34,10 +34,7 @@ export function isUsingLess(projectPath: string): boolean {
34
34
35
35
type Loader = Record < string , any >
36
36
37
- export async function maybeUseLess (
38
- projectPath : string ,
39
- mode : DevOptions [ 'mode' ]
40
- ) : Promise < Loader [ ] > {
37
+ export async function maybeUseLess ( projectPath : string ) : Promise < Loader [ ] > {
41
38
if ( ! isUsingLess ( projectPath ) ) return [ ]
42
39
43
40
try {
@@ -58,7 +55,7 @@ export async function maybeUseLess(
58
55
test : / \. l e s s $ / ,
59
56
use : [
60
57
{
61
- loader : 'less-loader'
58
+ loader : require . resolve ( 'less-loader' )
62
59
}
63
60
] ,
64
61
type : 'css/auto'
Original file line number Diff line number Diff line change @@ -34,10 +34,7 @@ export function isUsingSass(projectPath: string): boolean {
34
34
35
35
type Loader = Record < string , any >
36
36
37
- export async function maybeUseSass (
38
- projectPath : string ,
39
- mode : DevOptions [ 'mode' ]
40
- ) : Promise < Loader [ ] > {
37
+ export async function maybeUseSass ( projectPath : string ) : Promise < Loader [ ] > {
41
38
if ( ! isUsingSass ( projectPath ) ) return [ ]
42
39
43
40
try {
@@ -73,7 +70,7 @@ export async function maybeUseSass(
73
70
test : / \. ( s a s s | s c s s ) $ / ,
74
71
use : [
75
72
{
76
- loader : 'sass-loader' ,
73
+ loader : require . resolve ( 'sass-loader' ) ,
77
74
options : {
78
75
// using `modern-compiler` and `sass-embedded` together
79
76
// significantly improve build performance,
Original file line number Diff line number Diff line change @@ -45,14 +45,8 @@ export class CssPlugin {
45
45
Boolean
46
46
)
47
47
48
- const maybeInstallSass = await maybeUseSass (
49
- projectPath ,
50
- mode as 'development' | 'production'
51
- )
52
- const maybeInstallLess = await maybeUseLess (
53
- projectPath ,
54
- mode as 'development' | 'production'
55
- )
48
+ const maybeInstallSass = await maybeUseSass ( projectPath )
49
+ const maybeInstallLess = await maybeUseLess ( projectPath )
56
50
loaders . push ( ...maybeInstallSass )
57
51
loaders . push ( ...maybeInstallLess )
58
52
Original file line number Diff line number Diff line change @@ -157,7 +157,7 @@ export default function webpackConfig(
157
157
maxEntrypointSize : 999000
158
158
} ,
159
159
optimization : {
160
- minimize : devOptions . mode === 'production' ,
160
+ minimize : devOptions . mode === 'production'
161
161
} ,
162
162
experiments : {
163
163
// Enable native CSS support by default
You can’t perform that action at this time.
0 commit comments