Skip to content

Commit b54850c

Browse files
committed
fix: preprocessors merge 错误,不能设置 options
1 parent cd3fa6b commit b54850c

File tree

2 files changed

+25
-9
lines changed

2 files changed

+25
-9
lines changed

docs/guide/start.md

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ options 配置请参考 [postcss-px2units](https://www.npmjs.com/package/postcss
8888
#### `preprocessors`
8989
Type: `{[name: string]: processor}`
9090

91-
Type of `processor`: `extnames: Array<lang> | config`
91+
Type of `processor`: `extnames: config`
9292

9393
Type of `config`: `{ extnames: Array<lang> [, options: Object, process: process | void]}`
9494

@@ -132,10 +132,18 @@ module.exports = function (target) {
132132
}
133133
},
134134
preprocessors: {
135-
less: ['less'],
136-
sass: ['sass', 'scss'],
137-
stylus: ['stylus', 'styl'],
138-
typescript: ['ts']
135+
less: {
136+
extnames: ['less']
137+
},
138+
sass: {
139+
extnames: ['sass', 'scss']
140+
},
141+
stylus: {
142+
extnames: ['stylus', 'styl']
143+
},
144+
typescript: {
145+
extnames: ['ts']
146+
}
139147
},
140148
postprocessors: {
141149
postcss: {

packages/mars-build/src/scripts/defaultConfig.js

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,18 @@ module.exports = function (merge, target) {
2121
}
2222
},
2323
preprocessors: {
24-
less: ['less'],
25-
sass: ['sass', 'scss'],
26-
stylus: ['stylus', 'styl'],
27-
typescript: ['ts']
24+
less: {
25+
extnames: ['less']
26+
},
27+
sass: {
28+
extnames: ['sass', 'scss']
29+
},
30+
stylus: {
31+
extnames: ['stylus', 'styl']
32+
},
33+
typescript: {
34+
extnames: ['ts']
35+
}
2836
},
2937
postprocessors: {
3038
postcss: {

0 commit comments

Comments
 (0)