@storm-stack/core
Version:
A build toolkit and runtime used by Storm Software in TypeScript applications
51 lines (49 loc) • 1.51 kB
JavaScript
import { RESOLVE_NAMESPACE } from './chunk-SWD3ODIS.js';
import { __name } from './chunk-43IZMM3W.js';
import { LogLevelLabel } from '@storm-software/config-tools/types';
import { readFile } from '@stryke/fs/read-file';
var loader = new (void 0)();
var deepkitPlugin = /* @__PURE__ */ __name((context) => {
return {
name: "storm-stack:deepkit",
setup(build) {
build.onLoad({
filter: /.tsx?$/
}, async (args) => {
let contents;
try {
contents = await readFile(args.path);
if (args.pluginData?.isReflected) {
return {
contents,
// loader: "ts",
pluginData: {
...args.pluginData || {},
[RESOLVE_NAMESPACE]: {
isReflected: true
}
}
};
}
contents = loader.transform(contents, args.path);
} catch (error) {
context.log(LogLevelLabel.ERROR, `Deepkit reflection error for file "${args.path}": ${error instanceof Error ? error.message : String(error)}`);
return null;
}
return {
contents,
// loader: "ts",
pluginData: {
...args.pluginData || {},
[RESOLVE_NAMESPACE]: {
isReflected: true
}
}
};
});
}
};
}, "deepkitPlugin");
export { deepkitPlugin };
//# sourceMappingURL=chunk-L3JGZRL4.js.map
//# sourceMappingURL=chunk-L3JGZRL4.js.map