Skip to content

Commit a316b01

Browse files
committed
licensepluginのエラーを修正
1 parent 63e5bf2 commit a316b01

1 file changed

Lines changed: 16 additions & 1 deletion

File tree

next.config.ts

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { initOpenNextCloudflareForDev } from "@opennextjs/cloudflare";
33
import { PyodidePlugin } from "@pyodide/webpack-plugin";
44
import { version as pyodideVersion } from "pyodide/package.json";
55
import LicensePlugin from "webpack-license-plugin";
6+
import { dirname } from "node:path";
67

78
initOpenNextCloudflareForDev();
89

@@ -72,7 +73,21 @@ const nextConfig: NextConfig = {
7273
// クライアントビルドのみサードパーティライセンスを /_next/static/oss-licenses.json に出力
7374
if (!isServer) {
7475
config.plugins.push(
75-
new LicensePlugin({ outputFilename: "static/oss-licenses.json" })
76+
new LicensePlugin({
77+
outputFilename: "static/oss-licenses.json",
78+
includeNoticeText: true,
79+
excludedPackageTest: (packageName /*, version*/) => {
80+
return packageName.startsWith("@my-code");
81+
},
82+
licenseOverrides: {
83+
"@better-auth/core@1.4.20": "MIT",
84+
"@better-fetch/fetch@1.1.21": "MIT",
85+
},
86+
includePackages: () =>
87+
["tailwindcss", "@fontsource/m-plus-rounded-1c"].map((pkg) =>
88+
dirname(import.meta.resolve(`${pkg}/package.json`))
89+
),
90+
})
7691
);
7792
}
7893
return config;

0 commit comments

Comments
 (0)