This repository was archived by the owner on Jan 18, 2022. It is now read-only.
File tree 4 files changed +19
-13
lines changed
4 files changed +19
-13
lines changed Original file line number Diff line number Diff line change @@ -60,6 +60,9 @@ export default {
60
60
// Config for node-sass.
61
61
scss : { } ,
62
62
63
+ // Config for less.
64
+ less : { } ,
65
+
63
66
// Config for stylus.
64
67
stylus : { } ,
65
68
Original file line number Diff line number Diff line change 1
1
export default async function ( style , options ) {
2
2
const less = require ( 'less' )
3
- const { css, map } = await less . render ( style . code , {
4
- sourceMap : {
5
- sourceMapFullFilename : style . id ,
6
- sourceMapFileInline : false
7
- } ,
8
- ...options . less
9
- } )
3
+ const { css, map } = await less . render (
4
+ 'data' in options . less ? `${ options . less . data } \n${ style . code } ` : style . code ,
5
+ {
6
+ sourceMap : {
7
+ sourceMapFullFilename : style . id ,
8
+ sourceMapFileInline : false
9
+ } ,
10
+ ...options . less
11
+ }
12
+ )
10
13
11
14
style . $compiled = {
12
15
code : css . toString ( ) ,
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ export default function (style, options) {
5
5
debug ( `SASS: ${ style . id } ` )
6
6
const { css, map } = sass . renderSync ( {
7
7
file : style . id ,
8
- data : style . code ,
8
+ data : 'data' in options . scss ? ` ${ options . scss . data } \n ${ style . code } ` : style . code ,
9
9
omitSourceMapUrl : true ,
10
10
sourceMap : true ,
11
11
outFile : style . id ,
Original file line number Diff line number Diff line change 1
1
export default async function ( style , options ) {
2
2
const stylus = require ( 'stylus' )
3
- const stylusObj = stylus ( style . code , { ...options . stylus } )
4
- . set ( 'filename' , style . id )
5
- . set ( 'sourcemap' , {
6
- 'comment' : false
7
- } )
3
+ const stylusObj = stylus ( 'data' in options . stylus ? ` ${ options . stylus . data } \n ${ style . code } ` : style . code , { ...options . stylus } )
4
+ . set ( 'filename' , style . id )
5
+ . set ( 'sourcemap' , {
6
+ 'comment' : false
7
+ } )
8
8
9
9
const code = await stylusObj . render ( )
10
10
const map = stylusObj . sourcemap
You can’t perform that action at this time.
0 commit comments