We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1def5db commit fd3efa6Copy full SHA for fd3efa6
1 file changed
packages/compiler/src/plugins.ts
@@ -0,0 +1,18 @@
1
+import { UnpluginInstance } from 'unplugin';
2
+
3
+export function createNextPlugin<O>(unplugin: UnpluginInstance<O>) {
4
+ return (replexicaOptions: O, nextConfig: any) => {
5
+ return {
6
+ ...nextConfig,
7
+ webpack(config: any, options: any) {
8
+ config.plugins.unshift(unplugin.webpack(replexicaOptions));
9
10
+ if (typeof nextConfig.webpack === 'function') {
11
+ return nextConfig.webpack(config, options);
12
+ }
13
14
+ return config;
15
+ },
16
+ };
17
18
+}
0 commit comments