Skip to content

Commit 808bed4

Browse files
committed
sentryを別ファイルにしてみる
1 parent d01e487 commit 808bed4

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

next.config.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ const nextConfig: NextConfig = {
4343
},
4444
];
4545
},
46-
webpack: (config) => {
46+
webpack: (config, { isServer }) => {
4747
config.plugins.push(
4848
new PyodidePlugin({
4949
// public/ 以下に書き出すと404
@@ -52,6 +52,17 @@ const nextConfig: NextConfig = {
5252
outDirectory: `static/pyodide/v${pyodideVersion}`,
5353
})
5454
);
55+
if (isServer) {
56+
config.optimization.splitChunks.cacheGroups = {
57+
...config.optimization.splitChunks.cacheGroups,
58+
sentry: {
59+
test: /@sentry/,
60+
name: "sentry",
61+
priority: 10,
62+
enforce: true,
63+
},
64+
};
65+
}
5566
// import hoge from "./file?raw" でfileの中身を文字列としてインポート
5667
for (const rule of config.module.rules) {
5768
if (rule.resourceQuery instanceof RegExp) {

0 commit comments

Comments
 (0)