flowbite-react
Version:
Official React components built for Flowbite and Tailwind CSS
21 lines (20 loc) • 761 B
JavaScript
import { build } from "../cli/commands/build";
import { dev } from "../cli/commands/dev";
import { pluginName } from "./index.js";
const rspack = ()=>({
name: pluginName,
apply (compiler) {
let devServerStarted = false;
compiler.hooks.beforeCompile.tapPromise(pluginName, async ()=>{
const isDev = "development" === compiler.options.mode;
const isBuild = "production" === compiler.options.mode;
if (isBuild) await build();
else if (isDev && !devServerStarted) {
devServerStarted = true;
await dev();
}
});
}
});
export { rspack as default };
//# sourceMappingURL=rspack.js.map