diff --git a/examples/one-fullstack/app/login.tsx b/examples/one-fullstack/app/login.tsx index 79a9bcdd8..0af36514e 100644 --- a/examples/one-fullstack/app/login.tsx +++ b/examples/one-fullstack/app/login.tsx @@ -93,7 +93,7 @@ function SignIn() { if (!user) return ( - + diff --git a/next.md b/next.md index f8f13475a..915b28ecb 100644 --- a/next.md +++ b/next.md @@ -47,6 +47,8 @@ should have some sprints with "challenges": # backlog +- need a way ton configure the api + server etc during production builds + - style tag to CSS, we could have a mode that takes style tags with precedense/key set and have a mode to optimize that to css - perf - in dev mode collectStyle is called a ton on each load diff --git a/packages/one/src/vite/build.ts b/packages/one/src/vite/build.ts index 4c4577466..09e427ac7 100644 --- a/packages/one/src/vite/build.ts +++ b/packages/one/src/vite/build.ts @@ -5,7 +5,13 @@ import Path, { join, relative } from 'node:path' import type { OutputAsset } from 'rollup' import { nodeExternals } from 'rollup-plugin-node-externals' import { mergeConfig, build as viteBuild, type InlineConfig } from 'vite' -import { fillOptions, getOptimizeDeps, build as vxrnBuild, type ClientManifestEntry } from 'vxrn' +import { + fillOptions, + getOptimizeDeps, + rollupRemoveUnusedImportsPlugin, + build as vxrnBuild, + type ClientManifestEntry, +} from 'vxrn' import { getLoaderPath, getPreloadPath } from '../cleanUrl' import type { RouteInfo } from '../server/createRoutesManifest' import type { LoaderProps, RenderApp } from '../types' @@ -117,6 +123,12 @@ export async function build(args: { treeshake: { moduleSideEffects: 'no-external', }, + + plugins: [ + // otherwise rollup is leaving commonjs-only top level imports... + apiOutputFormat === 'esm' ? rollupRemoveUnusedImportsPlugin : null, + ].filter(Boolean), + // too many issues // treeshake: { // moduleSideEffects: false,