Skip to content

Commit f0577d2

Browse files
committed
rename option
1 parent aa74914 commit f0577d2

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

packages/nuxt/src/common/types.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -110,12 +110,12 @@ export type SentryNuxtModuleOptions = {
110110
* server entry file will disable Sentry on the server-side. When you set this option to `false`, make sure
111111
* to add the Sentry server config with the node `--import` CLI flag to enable Sentry on the server-side.
112112
*
113-
* **DO NOT** add the node CLI flag `--import` in your node start script, when `dynamicImportWrapping` is set to `true` (default).
113+
* **DO NOT** add the node CLI flag `--import` in your node start script, when `dynamicImportForServerEntry` is set to `true` (default).
114114
* This would initialize Sentry twice on the server-side and this leads to unexpected issues.
115115
*
116116
* @default true
117117
*/
118-
dynamicImportWrapping?: boolean;
118+
dynamicImportForServerEntry?: boolean;
119119

120120
/**
121121
* Options to be passed directly to the Sentry Rollup Plugin (`@sentry/rollup-plugin`) and Sentry Vite Plugin (`@sentry/vite-plugin`) that ship with the Sentry Nuxt SDK.

packages/nuxt/src/module.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export default defineNuxtModule<ModuleOptions>({
2020
setup(moduleOptionsParam, nuxt) {
2121
const moduleOptions = {
2222
...moduleOptionsParam,
23-
dynamicImportWrapping: moduleOptionsParam.dynamicImportWrapping !== false, // default: true
23+
dynamicImportForServerEntry: moduleOptionsParam.dynamicImportForServerEntry !== false, // default: true
2424
};
2525

2626
const moduleDirResolver = createResolver(import.meta.url);
@@ -53,7 +53,7 @@ export default defineNuxtModule<ModuleOptions>({
5353
const serverConfigFile = findDefaultSdkInitFile('server');
5454

5555
if (serverConfigFile) {
56-
if (moduleOptions.dynamicImportWrapping === false) {
56+
if (moduleOptions.dynamicImportForServerEntry === false) {
5757
// Inject the server-side Sentry config file with a side effect import
5858
addPluginTemplate({
5959
mode: 'server',
@@ -63,9 +63,9 @@ export default defineNuxtModule<ModuleOptions>({
6363
'import { defineNuxtPlugin } from "#imports"\n' +
6464
'export default defineNuxtPlugin(() => {})',
6565
});
66-
67-
addServerPlugin(moduleDirResolver.resolve('./runtime/plugins/sentry.server'));
6866
}
67+
68+
addServerPlugin(moduleDirResolver.resolve('./runtime/plugins/sentry.server'));
6969
}
7070

7171
if (clientConfigFile || serverConfigFile) {
@@ -74,7 +74,7 @@ export default defineNuxtModule<ModuleOptions>({
7474

7575
nuxt.hooks.hook('nitro:init', nitro => {
7676
if (serverConfigFile && serverConfigFile.includes('.server.config')) {
77-
if (moduleOptions.dynamicImportWrapping === false) {
77+
if (moduleOptions.dynamicImportForServerEntry === false) {
7878
addServerConfigToBuild(moduleOptions, nuxt, nitro, serverConfigFile);
7979

8080
if (moduleOptions.debug) {

0 commit comments

Comments
 (0)