Skip to content

Commit 4d9b618

Browse files
committed
ref: restore no longer needed changes to remix vite configs
1 parent 47001cb commit 4d9b618

File tree

9 files changed

+21
-25
lines changed

9 files changed

+21
-25
lines changed

dev-packages/e2e-tests/test-applications/create-remix-app-express-vite-dev/vite.config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { installGlobals } from '@remix-run/node';
22
import { vitePlugin as remix } from '@remix-run/dev';
3-
import Sentry from '@sentry/remix';
3+
import { sentryRemixVitePlugin } from '@sentry/remix';
44
import { defineConfig } from 'vite';
55
import tsconfigPaths from 'vite-tsconfig-paths';
66

@@ -9,7 +9,7 @@ installGlobals();
99
export default defineConfig({
1010
plugins: [
1111
remix(),
12-
Sentry.sentryRemixVitePlugin(),
12+
sentryRemixVitePlugin(),
1313
tsconfigPaths({
1414
// The dev server config errors are not relevant to this test app
1515
// https://github.com/aleclarson/vite-tsconfig-paths?tab=readme-ov-file#options

dev-packages/e2e-tests/test-applications/create-remix-app-express/vite.config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { installGlobals } from '@remix-run/node';
22
import { vitePlugin as remix } from '@remix-run/dev';
3-
import Sentry from '@sentry/remix';
3+
import { sentryRemixVitePlugin } from '@sentry/remix';
44
import { defineConfig } from 'vite';
55
import tsconfigPaths from 'vite-tsconfig-paths';
66

@@ -9,7 +9,7 @@ installGlobals();
99
export default defineConfig({
1010
plugins: [
1111
remix(),
12-
Sentry.sentryRemixVitePlugin(),
12+
sentryRemixVitePlugin(),
1313
tsconfigPaths({
1414
// The dev server config errors are not relevant to this test app
1515
// https://github.com/aleclarson/vite-tsconfig-paths?tab=readme-ov-file#options
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { vitePlugin as remix } from '@remix-run/dev';
2-
import Sentry from '@sentry/remix';
2+
import { sentryRemixVitePlugin } from '@sentry/remix';
33
import { defineConfig } from 'vite';
44
import tsconfigPaths from 'vite-tsconfig-paths';
55

@@ -9,7 +9,7 @@ export default defineConfig({
99
ignoredRouteFiles: ['**/.*'],
1010
serverModuleFormat: 'cjs',
1111
}),
12-
Sentry.sentryRemixVitePlugin(),
12+
sentryRemixVitePlugin(),
1313
tsconfigPaths(),
1414
],
1515
});

dev-packages/e2e-tests/test-applications/remix-hydrogen/vite.config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { vitePlugin as remix } from '@remix-run/dev';
2-
import Sentry from '@sentry/remix';
2+
import { sentryRemixVitePlugin } from '@sentry/remix';
33
import { hydrogen } from '@shopify/hydrogen/vite';
44
import { oxygen } from '@shopify/mini-oxygen/vite';
55
import { defineConfig } from 'vite';
@@ -17,7 +17,7 @@ export default defineConfig({
1717
v3_throwAbortReason: true,
1818
},
1919
}),
20-
Sentry.sentryRemixVitePlugin(),
20+
sentryRemixVitePlugin(),
2121
tsconfigPaths({
2222
// The dev server config errors are not relevant to this test app
2323
// https://github.com/aleclarson/vite-tsconfig-paths?tab=readme-ov-file#options

packages/remix/rollup.npm.config.mjs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@ export default [
1515
output: {
1616
// make it so Rollup calms down about the fact that we're combining default and named exports
1717
exports: 'named',
18-
// Always include __esModule marker for proper CJS/ESM interop
19-
// This ensures both `import * as Sentry` and `import Sentry` work correctly
20-
esModule: true,
2118
},
2219
},
2320
}),

packages/remix/src/config/vite.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,12 @@ const MANIFEST_GLOBAL_KEY = '_sentryRemixRouteManifest' as const;
3838
* // vite.config.ts
3939
* import { defineConfig } from 'vite';
4040
* import { vitePlugin as remix } from '@remix-run/dev';
41-
* import Sentry from '@sentry/remix';
41+
* import { sentryRemixVitePlugin } from '@sentry/remix';
4242
*
4343
* export default defineConfig({
4444
* plugins: [
4545
* remix(),
46-
* Sentry.sentryRemixVitePlugin({
46+
* sentryRemixVitePlugin({
4747
* appDirPath: './app',
4848
* }),
4949
* ],

packages/remix/test/config/vite.test.ts

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import * as os from 'os';
33
import * as path from 'path';
44
import type { Plugin, ResolvedConfig } from 'vite';
55
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
6-
import * as Sentry from '../..';
76
import { sentryRemixVitePlugin } from '../../src/config/vite';
87

98
describe('sentryRemixVitePlugin', () => {
@@ -36,21 +35,21 @@ describe('sentryRemixVitePlugin', () => {
3635

3736
describe('plugin configuration', () => {
3837
it('should return a valid Vite plugin with correct name', () => {
39-
const plugin = Sentry.sentryRemixVitePlugin();
38+
const plugin = sentryRemixVitePlugin();
4039

4140
expect(plugin).toBeDefined();
4241
expect(plugin.name).toBe('sentry-remix-route-manifest');
4342
expect(plugin.enforce).toBe('post');
4443
});
4544

4645
it('should accept custom appDirPath option', () => {
47-
const plugin = Sentry.sentryRemixVitePlugin({ appDirPath: '/custom/path' });
46+
const plugin = sentryRemixVitePlugin({ appDirPath: '/custom/path' });
4847

4948
expect(plugin).toBeDefined();
5049
});
5150

5251
it('should work with no options', () => {
53-
const plugin = Sentry.sentryRemixVitePlugin();
52+
const plugin = sentryRemixVitePlugin();
5453

5554
expect(plugin).toBeDefined();
5655
});
@@ -63,7 +62,7 @@ describe('sentryRemixVitePlugin', () => {
6362
fs.writeFileSync(path.join(routesDir, 'about.tsx'), '// about');
6463
fs.writeFileSync(path.join(routesDir, 'users.$id.tsx'), '// users');
6564

66-
const plugin = Sentry.sentryRemixVitePlugin();
65+
const plugin = sentryRemixVitePlugin();
6766

6867
const mockConfig: Partial<ResolvedConfig> = {
6968
root: tempDir,
@@ -82,7 +81,7 @@ describe('sentryRemixVitePlugin', () => {
8281
fs.writeFileSync(path.join(routesDir, 'index.tsx'), '// index');
8382
fs.writeFileSync(path.join(routesDir, 'users.$id.tsx'), '// users');
8483

85-
const plugin = Sentry.sentryRemixVitePlugin();
84+
const plugin = sentryRemixVitePlugin();
8685

8786
const mockConfig: Partial<ResolvedConfig> = {
8887
root: tempDir,
@@ -98,7 +97,7 @@ describe('sentryRemixVitePlugin', () => {
9897
});
9998

10099
it('should handle errors gracefully and set empty manifest', () => {
101-
const plugin = Sentry.sentryRemixVitePlugin({ appDirPath: '/nonexistent/path' });
100+
const plugin = sentryRemixVitePlugin({ appDirPath: '/nonexistent/path' });
102101

103102
const mockConfig: Partial<ResolvedConfig> = {
104103
root: tempDir,
@@ -119,7 +118,7 @@ describe('sentryRemixVitePlugin', () => {
119118
fs.mkdirSync(customRoutesDir, { recursive: true });
120119
fs.writeFileSync(path.join(customRoutesDir, 'index.tsx'), '// index');
121120

122-
const plugin = Sentry.sentryRemixVitePlugin({ appDirPath: customAppDir });
121+
const plugin = sentryRemixVitePlugin({ appDirPath: customAppDir });
123122

124123
const mockConfig: Partial<ResolvedConfig> = {
125124
root: tempDir,
@@ -137,7 +136,7 @@ describe('sentryRemixVitePlugin', () => {
137136
it('should inject manifest into HTML with <head> tag', () => {
138137
fs.writeFileSync(path.join(routesDir, 'index.tsx'), '// index');
139138

140-
const plugin = Sentry.sentryRemixVitePlugin();
139+
const plugin = sentryRemixVitePlugin();
141140

142141
const mockConfig: Partial<ResolvedConfig> = {
143142
root: tempDir,

packages/remix/test/integration/instrument.server.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import Sentry from '@sentry/remix';
1+
import * as Sentry from '@sentry/remix';
22

33
Sentry.init({
44
dsn: 'https://[email protected]/1337',

packages/remix/test/integration/vite.config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { vitePlugin as remix } from '@remix-run/dev';
22
import { defineConfig, Plugin } from 'vite';
3-
import Sentry from '@sentry/remix';
3+
import { sentryRemixVitePlugin } from '@sentry/remix';
44
import path from 'path';
55

66
// Custom plugin to resolve @sentry/remix to ESM builds for Vite
@@ -37,6 +37,6 @@ export default defineConfig({
3737
v3_lazyRouteDiscovery: true,
3838
},
3939
}),
40-
Sentry.sentryRemixVitePlugin(),
40+
sentryRemixVitePlugin(),
4141
],
4242
});

0 commit comments

Comments
 (0)