11const crypto = require ( 'crypto' ) ;
22
3- const { InjectManifest } = require ( 'workbox-webpack-plugin' ) ;
4-
53const buildId = crypto . randomBytes ( 256 ) . toString ( 'hex' ) . slice ( 0 , 8 ) ;
64
75/** @type {import('next').NextConfig } */
@@ -12,44 +10,22 @@ const nextConfig = {
1210 unoptimized : true ,
1311 } ,
1412 compiler : {
15- // Enables the styled-components SWC transform
1613 styledComponents : true ,
1714 } ,
1815 generateBuildId : ( ) => buildId ,
1916 env : {
2017 NEXT_PUBLIC_BUILD_ID : buildId ,
2118 } ,
22- webpack ( config , { isServer } ) {
23- // Grab the existing rule that handles SVG imports
24- const fileLoaderRule = config . module . rules . find ( ( rule ) =>
25- rule . test ?. test ?. ( '.svg' ) ,
26- ) ;
27-
28- config . module . rules . push (
29- // Reapply the existing rule, but only for svg imports ending in ?url
30- {
31- ...fileLoaderRule ,
32- test : / \. s v g $ / i,
33- resourceQuery : / u r l / , // *.svg?url
34- } ,
35- // Convert all other *.svg imports to React components
36- {
37- test : / \. s v g $ / i,
38- issuer : fileLoaderRule . issuer ,
39- resourceQuery : { not : [ ...fileLoaderRule . resourceQuery . not , / u r l / ] } , // exclude if *.svg?url
40- use : [ '@svgr/webpack' ] ,
19+ turbopack : {
20+ rules : {
21+ '*.svg' : {
22+ loaders : [ '@svgr/webpack' ] ,
23+ as : '*.js' ,
4124 } ,
42- ) ;
43-
44- // Modify the file loader rule to ignore *.svg, since we have it handled now.
45- fileLoaderRule . exclude = / \. s v g $ / i;
46-
47- // Formula rendering in markdown, replace dollar-sign with \(...\) and \[...\]
48- // https://github.com/remarkjs/remark-math/issues/39#issuecomment-2636184992
49- config . resolve . alias [ 'micromark-extension-math' ] =
50- 'micromark-extension-llm-math' ;
51-
52- return config ;
25+ } ,
26+ resolveAlias : {
27+ 'micromark-extension-math' : 'micromark-extension-llm-math' ,
28+ } ,
5329 } ,
5430} ;
5531
0 commit comments