Skip to content
Merged
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
2 changes: 2 additions & 0 deletions packages/start-plugin-core/src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,5 @@ export const ENTRY_POINTS = {
start: '#tanstack-start-entry',
router: '#tanstack-router-entry',
} as const

export const TRANSFORM_ID_REGEX = [/\.[cm]?tsx?$/, /\.[cm]?jsx?$/]
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { VITE_ENVIRONMENT_NAMES } from '../constants'
import { TRANSFORM_ID_REGEX, VITE_ENVIRONMENT_NAMES } from '../constants'
import { ServerFnCompiler } from './compiler'
import type { LookupConfig, LookupKind } from './compiler'
import type { CompileStartFrameworkOptions } from '../start-compiler-plugin/compilers'
Expand Down Expand Up @@ -81,6 +81,7 @@ export function createServerFnPlugin(
filter: {
id: {
exclude: new RegExp(`${SERVER_FN_LOOKUP}$`),
include: TRANSFORM_ID_REGEX,
},
code: {
// TODO apply this plugin with a different filter per environment so that .createMiddleware() calls are not scanned in server env
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { VIRTUAL_MODULES } from '@tanstack/start-server-core'
import { normalizePath } from 'vite'
import path from 'pathe'
import { makeIdFiltersToMatchWithQuery } from '@rolldown/pluginutils'
import { VITE_ENVIRONMENT_NAMES } from '../constants'
import { TRANSFORM_ID_REGEX, VITE_ENVIRONMENT_NAMES } from '../constants'
import { compileStartOutputFactory } from './compilers'
import { transformFuncs } from './constants'
import type { ViteEnvironmentNames } from '../constants'
Expand Down Expand Up @@ -54,6 +54,7 @@ export function startCompilerPlugin(
filter: {
code: tokenRegex,
id: {
include: TRANSFORM_ID_REGEX,
exclude: [
VIRTUAL_MODULES.serverFnManifest,
// N.B. the following files either just re-export or provide the runtime implementation of those functions
Expand Down
Loading