File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -128,7 +128,7 @@ export function loadPresets() {
128
128
]
129
129
}
130
130
131
- export function preProcessJs ( options : IPreProcessJsOptions ) {
131
+ export function preProcessJs ( options : IPreProcessJsOptions ) : string {
132
132
const { code, replaceMap, id, ctx } = options
133
133
const magicString = typeof code === 'string' ? new MagicString ( code ) : code
134
134
let ast : ParseResult < babel . types . File >
@@ -140,10 +140,10 @@ export function preProcessJs(options: IPreProcessJsOptions) {
140
140
if ( file ) {
141
141
ast = file
142
142
} else {
143
- return code
143
+ return code . toString ( )
144
144
}
145
145
} catch {
146
- return code
146
+ return code . toString ( )
147
147
}
148
148
const markedArray : [ number , number ] [ ] = [ ]
149
149
babel . traverse ( ast , {
@@ -216,7 +216,7 @@ interface IPreProcessRawCodeOptions {
216
216
ctx : Context
217
217
}
218
218
219
- export function preProcessRawCode ( options : IPreProcessRawCodeOptions ) {
219
+ export function preProcessRawCode ( options : IPreProcessRawCodeOptions ) : string {
220
220
const { code, replaceMap, ctx } = options
221
221
const magicString = typeof code === 'string' ? new MagicString ( code ) : code
222
222
const markArr : [ number , number ] [ ] = [ ]
You can’t perform that action at this time.
0 commit comments