'use strict';

var chunkAF3E2D32_cjs = require('./chunk-AF3E2D32.cjs');
var types = require('@storm-software/config-tools/types');
var readFile = require('@stryke/fs/read-file');
var correctPath = require('@stryke/path/correct-path');

function compilerPlugin(log, context, options) {
  return {
    name: "storm-stack:compiler",
    setup(build) {
      build.onLoad({
        filter: /\.ts$/
      }, async (args) => {
        log(types.LogLevelLabel.TRACE, `Transforming ${args.path} with Storm Stack compiler`);
        return {
          contents: await context.compiler.compile(context, correctPath.normalizeWindowsPath(args.path), await readFile.readFile(args.path), options)
        };
      });
    }
  };
}
chunkAF3E2D32_cjs.__name(compilerPlugin, "compilerPlugin");

exports.compilerPlugin = compilerPlugin;
//# sourceMappingURL=chunk-PZELMXXD.cjs.map
//# sourceMappingURL=chunk-PZELMXXD.cjs.map