Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,4 @@ dist-basic/
!.vitrine/project.json
!.vitrine/plans
!.vitrine/assets
.vitrine-hooks/
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,10 @@
"typescript": "5.4.3"
},
"resolutions": {
"rollup": "4.45.1",
"rollup": "4.62.0",
"dts-bundle-generator/typescript": "5.4.3",
"dts-bundle-generator@npm:9.5.1": "patch:dts-bundle-generator@npm%3A9.5.1#~/.yarn/patches/dts-bundle-generator-npm-9.5.1-0927b6826f.patch"
"dts-bundle-generator@npm:9.5.1": "patch:dts-bundle-generator@npm%3A9.5.1#~/.yarn/patches/dts-bundle-generator-npm-9.5.1-0927b6826f.patch",
"@types/estree": "1.0.8"
},
"packageManager": "yarn@4.10.3"
}
2 changes: 1 addition & 1 deletion packages/plugins/apps/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"devDependencies": {
"@types/eslint-scope": "3.7.7",
"@types/estree": "1.0.8",
"rollup": "4.45.1",
"rollup": "4.62.0",
"typescript": "5.4.3",
"vite": "6.3.5"
}
Expand Down
2 changes: 1 addition & 1 deletion packages/plugins/bundler-report/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"@dd/core": "workspace:*"
},
"devDependencies": {
"rollup": "4.45.1",
"rollup": "4.62.0",
"typescript": "5.4.3"
}
}
2 changes: 1 addition & 1 deletion packages/published/esbuild-plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
"@types/babel__preset-env": "^7",
"dts-bundle-generator": "patch:dts-bundle-generator@npm%3A9.5.1#~/.yarn/patches/dts-bundle-generator-npm-9.5.1-0927b6826f.patch",
"esbuild": "0.25.8",
"rollup": "4.45.1",
"rollup": "4.62.0",
"rollup-plugin-esbuild": "6.1.1",
"typescript": "5.4.3"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/published/esbuild-plugin/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import type {
import * as factory from '@dd/factory';
import esbuild from 'esbuild';

import pkg from '../package.json';
import pkg from '../package.json' with { type: 'json' };

export type EsbuildPluginOptions = Options;
export type {
Expand Down
2 changes: 1 addition & 1 deletion packages/published/rollup-plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
"@types/babel__preset-env": "^7",
"dts-bundle-generator": "patch:dts-bundle-generator@npm%3A9.5.1#~/.yarn/patches/dts-bundle-generator-npm-9.5.1-0927b6826f.patch",
"esbuild": "0.25.8",
"rollup": "4.45.1",
"rollup": "4.62.0",
"rollup-plugin-esbuild": "6.1.1",
"typescript": "5.4.3"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/published/rollup-plugin/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import type {
import * as factory from '@dd/factory';
import * as rollup from 'rollup';

import pkg from '../package.json';
import pkg from '../package.json' with { type: 'json' };

export type RollupPluginOptions = Options;
export type {
Expand Down
2 changes: 1 addition & 1 deletion packages/published/rspack-plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
"@types/babel__preset-env": "^7",
"dts-bundle-generator": "patch:dts-bundle-generator@npm%3A9.5.1#~/.yarn/patches/dts-bundle-generator-npm-9.5.1-0927b6826f.patch",
"esbuild": "0.25.8",
"rollup": "4.45.1",
"rollup": "4.62.0",
"rollup-plugin-esbuild": "6.1.1",
"typescript": "5.4.3"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/published/rspack-plugin/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import type {
import * as factory from '@dd/factory';
import rspack from '@rspack/core';

import pkg from '../package.json';
import pkg from '../package.json' with { type: 'json' };

export type RspackPluginOptions = Options;
export type {
Expand Down
4 changes: 2 additions & 2 deletions packages/published/vite-plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
"@types/babel__preset-env": "^7",
"dts-bundle-generator": "patch:dts-bundle-generator@npm%3A9.5.1#~/.yarn/patches/dts-bundle-generator-npm-9.5.1-0927b6826f.patch",
"esbuild": "0.25.8",
"rollup": "4.45.1",
"rollup": "4.62.0",
"rollup-plugin-esbuild": "6.1.1",
"typescript": "5.4.3"
},
Expand All @@ -90,7 +90,7 @@
"@babel/traverse": "^7.24.5",
"@babel/types": "^7.24.5",
"magic-string": "^0.30.0",
"vite": ">= 5.x <= 7.x"
"vite": ">= 5.x <= 8.x"
},
"peerDependenciesMeta": {
"@babel/parser": {
Expand Down
2 changes: 1 addition & 1 deletion packages/published/vite-plugin/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import type {
import * as factory from '@dd/factory';
import * as vite from 'vite';

import pkg from '../package.json';
import pkg from '../package.json' with { type: 'json' };

export type VitePluginOptions = Options;
export type {
Expand Down
2 changes: 1 addition & 1 deletion packages/published/webpack-plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
"@types/babel__preset-env": "^7",
"dts-bundle-generator": "patch:dts-bundle-generator@npm%3A9.5.1#~/.yarn/patches/dts-bundle-generator-npm-9.5.1-0927b6826f.patch",
"esbuild": "0.25.8",
"rollup": "4.45.1",
"rollup": "4.62.0",
"rollup-plugin-esbuild": "6.1.1",
"typescript": "5.4.3"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/published/webpack-plugin/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import type {
import * as factory from '@dd/factory';
import webpack from 'webpack';

import pkg from '../package.json';
import pkg from '../package.json' with { type: 'json' };

export type WebpackPluginOptions = Options;
export type {
Expand Down
2 changes: 1 addition & 1 deletion packages/tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
"esbuild": "0.25.8",
"faker": "5.5.3",
"nock": "14.0.1",
"rollup": "4.45.1",
"rollup": "4.62.0",
"strip-ansi": "6.0.1",
"ts-loader": "9.5.2",
"typescript": "5.4.3",
Expand Down
5 changes: 4 additions & 1 deletion packages/tests/src/_jest/fixtures/.gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
massiveProject
yarn-error.log
.yarn/*
!.yarn/cache
# Do not store the cache of the fixtures, it is too heavy.
# It gets repopulated by the `yarn install` ran in globalSetup.
!.yarn/patches
!.yarn/releases
!.yarn/plugins
!.vscode

node_modules/
dist/
build/
.react-router/
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
3 changes: 2 additions & 1 deletion packages/tests/src/_jest/fixtures/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"packageManager": "yarn@4.2.1",
"workspaces": [
"hard_project",
"easy_project"
"easy_project",
"vite_react_router_project"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// Unless explicitly stated otherwise all files in this repository are licensed under the MIT License.
// This product includes software developed at Datadog (https://www.datadoghq.com/).
// Copyright 2019-Present Datadog, Inc.

import { Links, Meta, Outlet, Scripts, ScrollRestoration } from 'react-router';

export default function App() {
return <Outlet />;
}

export function Layout({ children }) {
return (
<html lang="en">
<head>
<meta charSet="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<Meta />
<Links />
</head>
<body>
{children}
<ScrollRestoration />
<Scripts />
</body>
</html>
);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// Unless explicitly stated otherwise all files in this repository are licensed under the MIT License.
// This product includes software developed at Datadog (https://www.datadoghq.com/).
// Copyright 2019-Present Datadog, Inc.

import { index } from '@react-router/dev/routes';

export default [index('routes/home.jsx')];
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// Unless explicitly stated otherwise all files in this repository are licensed under the MIT License.
// This product includes software developed at Datadog (https://www.datadoghq.com/).
// Copyright 2019-Present Datadog, Inc.

export function meta() {
return [
{ title: 'New React Router App' },
{ name: 'description', content: 'Welcome to React Router!' },
];
}

export default function Home() {
return (
<div>
<h1>Home</h1>
</div>
);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<!doctype html>
<html lang="en">

<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite React Router Test</title>
</head>

<body>
<div id="root"></div>
<script type="module" src="/app/root.jsx"></script>
</body>

</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"name": "@tests/vite_react_router_project",
"private": true,
"license": "MIT",
"author": "Datadog",
"type": "module",
"packageManager": "yarn@4.2.1",
"scripts": {
"build": "vite build",
"dev": "vite"
},
"dependencies": {
"@react-router/node": "8.0.0",
"isbot": "5.1.43",
"react": "19.2.7",
"react-dom": "19.2.7",
"react-router": "8.0.0"
},
"devDependencies": {
"@datadog/vite-plugin": "link:../../../../published/vite-plugin",
"@react-router/dev": "8.0.0",
"@vitejs/plugin-react-swc": "4.3.1",
"vite": "8.0.16"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// Unless explicitly stated otherwise all files in this repository are licensed under the MIT License.
// This product includes software developed at Datadog (https://www.datadoghq.com/).
// Copyright 2019-Present Datadog, Inc.

import { reactRouter } from '@react-router/dev/vite';
import { datadogVitePlugin } from '@datadog/vite-plugin/dist/src';
import react from '@vitejs/plugin-react-swc';
import { defineConfig } from 'vite';

export default defineConfig({
plugins: [
datadogVitePlugin({
enableGit: false,
auth: {
apiKey: process.env.DATADOG_API_KEY || 'fake-api-key',
},
rum: {
sourcemaps: {
bailOnError: true,
releaseVersion: `app@vite`,
service: 'x',
minifiedPathPrefix: '/static',
},
},
logLevel: 'debug',
output: {},
metrics: { enable: false },
}),
react(),
reactRouter(),
],
build: {
outDir: 'dist',
sourcemap: false,
},
});
Loading
Loading