diff --git a/src/index.js b/src/index.js index ccaaff4..4c8d601 100644 --- a/src/index.js +++ b/src/index.js @@ -74,6 +74,13 @@ function makeLoader() { programmaticOptions.sourceMaps = true; } + if (programmaticOptions.plugin) { + const passInPlugin = programmaticOptions.plugin; + programmaticOptions.plugin = (m) => { + return passInPlugin(m, this); + }; + } + try { if (sync) { const output = swc.transformSync(source, programmaticOptions);