File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -15,7 +15,18 @@ const nextConfig: NextConfig = {
1515 typescript : {
1616 ignoreBuildErrors : true ,
1717 } ,
18- serverExternalPackages : [ "@prisma/client" , ".prisma/client" ] ,
18+ serverExternalPackages : [
19+ "@prisma/client" ,
20+ ".prisma/client" ,
21+ // 普通にimportするとこれが4回バンドルされてcloudflareの3MB制限を超えてしまう
22+ "@sentry/nextjs" ,
23+ ] ,
24+ outputFileTracingIncludes : {
25+ // sentryのバージョン違うけど、serverExternalPackagesに@sentry/nextjsを追加したら
26+ // https://github.com/getsentry/sentry-javascript/issues/14931#issuecomment-3641871022
27+ // と同じエラーが出たので、そこに書かれていたのと同じでっちあげをしてみる
28+ "*" : [ "node_modules/@sentry/nextjs/build/**/*" ] ,
29+ } ,
1930 async headers ( ) {
2031 return [
2132 {
@@ -43,7 +54,7 @@ const nextConfig: NextConfig = {
4354 } ,
4455 ] ;
4556 } ,
46- webpack : ( config , { isServer } ) => {
57+ webpack : ( config ) => {
4758 config . plugins . push (
4859 new PyodidePlugin ( {
4960 // public/ 以下に書き出すと404
@@ -52,21 +63,6 @@ const nextConfig: NextConfig = {
5263 outDirectory : `static/pyodide/v${ pyodideVersion } ` ,
5364 } )
5465 ) ;
55- if ( isServer ) {
56- config . optimization . splitChunks . cacheGroups = {
57- ...config . optimization . splitChunks . cacheGroups ,
58- sentry : {
59- test : / @ s e n t r y / ,
60- priority : 10 ,
61- enforce : true ,
62- } ,
63- opentelemetry : {
64- test : / (?< ! c o m p i l e d \/ @ ? ) o p e n t e l e m e t r y / ,
65- priority : 10 ,
66- enforce : true ,
67- } ,
68- } ;
69- }
7066 // import hoge from "./file?raw" でfileの中身を文字列としてインポート
7167 for ( const rule of config . module . rules ) {
7268 if ( rule . resourceQuery instanceof RegExp ) {
You can’t perform that action at this time.
0 commit comments