@@ -2,13 +2,13 @@ import type { NextConfig } from "next";
22import { initOpenNextCloudflareForDev } from "@opennextjs/cloudflare" ;
33import { PyodidePlugin } from "@pyodide/webpack-plugin" ;
44import { version as pyodideVersion } from "pyodide/package.json" ;
5- import LicensePlugin from "webpack-license-plugin" ;
65import { dirname } from "node:path" ;
76import { withSentryConfig } from "@sentry/nextjs" ;
7+ import { withLicense } from "next-license-list/config" ;
88
99initOpenNextCloudflareForDev ( ) ;
1010
11- const nextConfig : NextConfig = {
11+ let nextConfig : NextConfig = {
1212 /* config options here */
1313 output : "standalone" ,
1414 experimental : {
@@ -59,7 +59,7 @@ const nextConfig: NextConfig = {
5959 } ,
6060 ] ;
6161 } ,
62- webpack : ( config , { isServer } ) => {
62+ webpack : ( config ) => {
6363 config . plugins . push (
6464 new PyodidePlugin ( {
6565 // public/ 以下に書き出すと404
@@ -85,28 +85,6 @@ const nextConfig: NextConfig = {
8585 resourceQuery : / r a w / ,
8686 type : "asset/source" ,
8787 } ) ;
88- // クライアントビルドのみサードパーティライセンスを /_next/static/oss-licenses.json に出力
89- if ( ! isServer ) {
90- config . plugins . push (
91- new LicensePlugin ( {
92- outputFilename : "static/oss-licenses.json" ,
93- includeNoticeText : true ,
94- excludedPackageTest : ( packageName /*, version*/ ) => {
95- return (
96- packageName . startsWith ( "@my-code" ) || packageName === "my-code"
97- ) ;
98- } ,
99- licenseOverrides : {
100- "@better-auth/core@1.4.20" : "MIT" ,
101- "@better-fetch/fetch@1.1.21" : "MIT" ,
102- } ,
103- includePackages : ( ) =>
104- [ "tailwindcss" , "daisyui" , "@fontsource/m-plus-rounded-1c" ] . map (
105- ( pkg ) => dirname ( import . meta. resolve ( `${ pkg } /package.json` ) )
106- ) ,
107- } )
108- ) ;
109- }
11088 return config ;
11189 } ,
11290 async redirects ( ) {
@@ -183,7 +161,21 @@ const nextConfig: NextConfig = {
183161 } ,
184162} ;
185163
186- export default withSentryConfig ( nextConfig , {
164+ nextConfig = withLicense ( nextConfig , {
165+ includeNoticeText : true ,
166+ excludedPackageTest : ( packageName /*, version*/ ) => {
167+ return packageName . startsWith ( "@my-code" ) || packageName === "my-code" ;
168+ } ,
169+ licenseOverrides : {
170+ "@better-auth/core@1.4.20" : "MIT" ,
171+ "@better-fetch/fetch@1.1.21" : "MIT" ,
172+ } ,
173+ includePackages : ( ) =>
174+ [ "tailwindcss" , "daisyui" , "@fontsource/m-plus-rounded-1c" ] . map ( ( pkg ) =>
175+ dirname ( import . meta. resolve ( `${ pkg } /package.json` ) )
176+ ) ,
177+ } ) ;
178+ nextConfig = withSentryConfig ( nextConfig , {
187179 org : process . env . SENTRY_ORG ,
188180 project : process . env . SENTRY_PROJECT ,
189181 sentryUrl : process . env . SENTRY_URL ,
@@ -210,3 +202,5 @@ export default withSentryConfig(nextConfig, {
210202 excludeReplayWorker : true ,
211203 } ,
212204} ) ;
205+
206+ export default nextConfig ;
0 commit comments