Skip to content

Commit f7fc966

Browse files
committed
默认支持 scss/sass
1 parent 51505ca commit f7fc966

File tree

8 files changed

+18
-19444
lines changed

8 files changed

+18
-19444
lines changed

.dawn/pipe.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ build:
1616
location: ./lib/index.js
1717
entry: ./demo/*.{js,jsx,ts,tsx}
1818
template: ./demo/assets/*.html
19-
cssModules: true
19+
cssModules: false
2020
compress: false
2121
stats: true
2222

demo/assets/test1.css

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
@import url('./index.less');
21

32
.test1 {
43
color: red;

demo/assets/test3.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
@import url('./test4.scss');

demo/assets/test4.scss

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.test4 {
2+
color: red;
3+
}

demo/test1.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ const config = require('$config');
44

55
const styles1 = require('./assets/index.less');
66
const styles2 = require('./assets/test1.css');
7+
const styles3 = require('./assets/test3.scss');
8+
79
const test4 = require('./test4.vue');
810

911
log('这是 test1');

lib/generate.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,14 @@ async function handlerPlugins(wpConfig, opts) {
151151
}, 'less-loader'],
152152
publicPath: '../'
153153
})
154+
}, {
155+
test: /\.(scss|sass)$/,
156+
loader: cssExtractPlugin.extract({
157+
use: [{
158+
loader: 'css-loader', options: cssLoaderOptions
159+
}, 'fast-sass-loader'],
160+
publicPath: '../'
161+
})
154162
}, {
155163
test: /\.css$/,
156164
loader: cssExtractPlugin.extract({

0 commit comments

Comments
 (0)