11import rehypeSlug from 'rehype-slug' ;
22import remarkGfm from 'remark-gfm' ;
33import nextMdx from '@next/mdx' ;
4- import withPlugins from 'next-compose-plugins' ;
54
65const withMDX = nextMdx ( {
76 extension : / \. m d x ? $ / ,
@@ -12,42 +11,28 @@ const withMDX = nextMdx({
1211 } ,
1312} ) ;
1413
15- const withSvgr = ( nextConfig = { } , nextComposePlugins = { } ) => {
16- return Object . assign ( { } , nextConfig , {
17- webpack ( config , options ) {
18- config . module . rules . push ( {
19- test : / .s v g $ / ,
20- use : [ '@svgr/webpack' ] ,
21- } ) ;
22-
23- if ( typeof nextConfig . webpack === 'function' ) {
24- return nextConfig . webpack ( config , options ) ;
25- }
26-
27- return config ;
28- } ,
29- } ) ;
14+ /** @type {import('next').NextConfig } */
15+ const nextConfig = {
16+ pageExtensions : [ 'ts' , 'tsx' , 'md' , 'mdx' ] ,
17+ webpack ( config ) {
18+ config . module . rules . push ( {
19+ test : / \. s v g $ / ,
20+ use : [ '@svgr/webpack' ] ,
21+ } ) ;
22+ return config ;
23+ } ,
24+ async rewrites ( ) {
25+ return [
26+ {
27+ source : '/bee.js' ,
28+ destination : 'https://cdn.splitbee.io/sb.js' ,
29+ } ,
30+ {
31+ source : '/_hive/:slug' ,
32+ destination : 'https://hive.splitbee.io/:slug' ,
33+ } ,
34+ ] ;
35+ } ,
3036} ;
3137
32- export default withPlugins (
33- [
34- withMDX ( {
35- pageExtensions : [ 'ts' , 'tsx' , 'md' , 'mdx' ] ,
36- } ) ,
37- withSvgr ,
38- ] ,
39- {
40- rewrites ( ) {
41- return [
42- {
43- source : '/bee.js' ,
44- destination : 'https://cdn.splitbee.io/sb.js' ,
45- } ,
46- {
47- source : '/_hive/:slug' ,
48- destination : 'https://hive.splitbee.io/:slug' ,
49- } ,
50- ] ;
51- } ,
52- }
53- ) ;
38+ export default withMDX ( nextConfig ) ;
0 commit comments