Skip to content

Commit 517bc5c

Browse files
committed
feat: expose loader context and virtual write to preprocess
1 parent d4e2c20 commit 517bc5c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

index.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,11 @@ module.exports = function(source, map) {
133133
}
134134

135135
if (options.emitCss) compileOptions.css = false;
136-
136+
137+
if (typeof options.preprocess === 'function') {
138+
options.preprocess = options.preprocess(this, virtualModules.writeModule.bind(virtualModules));
139+
}
140+
137141
deprecatePreprocessOptions(options);
138142
options.preprocess.filename = compileOptions.filename;
139143

0 commit comments

Comments
 (0)