flowbite-react
Version:
Official React components built for Flowbite and Tailwind CSS
33 lines (30 loc) • 895 B
JavaScript
import { build } from '../cli/commands/build.js';
import { dev } from '../cli/commands/dev.js';
function withFlowbiteReact(nextConfig = {}) {
if (process.env.NODE_ENV === "development") {
dev();
}
if (process.env.NODE_ENV === "production") {
build();
}
if (typeof nextConfig === "function") {
return async (phase, options) => {
const originalConfig = await nextConfig(phase, options);
return patchConfig(originalConfig);
};
}
return patchConfig(nextConfig);
}
function patchConfig(config) {
const experimental = config.experimental || {};
const optimizePackageImports = experimental.optimizePackageImports || [];
return {
...config,
experimental: {
...experimental,
optimizePackageImports: [...optimizePackageImports, "flowbite-react"]
}
};
}
export { withFlowbiteReact as default };
//# sourceMappingURL=nextjs.js.map