File tree 2 files changed +15
-1
lines changed
2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -37,7 +37,6 @@ const tildeImporter: Importer = (url, prev) => {
37
37
38
38
const modulePath = join ( 'node_modules' , ...url . slice ( 1 ) . split ( / [ \\ / ] / g) ) ;
39
39
40
- // todo: maybe create a smaller findup utility method?
41
40
const foundPath = findUp ( { what : modulePath , from : prev } ) ;
42
41
43
42
// istanbul ignore if
@@ -68,6 +67,7 @@ const transformer: Transformer<Options.Sass> = async ({
68
67
...options ,
69
68
includePaths : getIncludePaths ( filename , options . includePaths ) ,
70
69
outFile : `${ filename } .css` ,
70
+ omitSourceMapUrl : true , // return sourcemap only in result.map
71
71
} ;
72
72
73
73
const sassOptions = {
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ import { resolve } from 'path';
6
6
import sveltePreprocess from '../../src' ;
7
7
import { preprocess } from '../utils' ;
8
8
import type { Options } from '../../src/types' ;
9
+ import { transformer } from '../../src/transformers/scss' ;
9
10
10
11
const implementation : Options . Sass [ 'implementation' ] = {
11
12
render ( options , callback ) {
@@ -121,4 +122,17 @@ describe('transformer - scss', () => {
121
122
}</style>"
122
123
` ) ;
123
124
} ) ;
125
+
126
+ it ( 'returns the source map and removes sourceMappingURL from code' , async ( ) => {
127
+ const content = 'div{color:red}' ;
128
+ const filename = '/file' ;
129
+ const options = {
130
+ sourceMap : true ,
131
+ } ;
132
+
133
+ const { map, code } = await transformer ( { content, filename, options } ) ;
134
+
135
+ expect ( code ) . not . toContain ( 'sourceMappingURL' ) ;
136
+ expect ( map ) . toBeTruthy ( ) ;
137
+ } ) ;
124
138
} ) ;
You can’t perform that action at this time.
0 commit comments