Skip to content

Commit 6d3eba1

Browse files
committed
fix typo. get file transformer tests working
1 parent cbeec59 commit 6d3eba1

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

packages/springboard/cli/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@
2929
"clean": "rm -rf dist",
3030
"add-header": "./scripts/add-node-executable-header.sh",
3131
"cli-docs": "npx tsx scripts/make_cli_docs.ts",
32-
"check-types": "tsc --noEmit"
32+
"check-types": "tsc --noEmit",
33+
"test": "vitest run",
34+
"test:watch": "vitest"
3335
},
3436
"dependencies": {
3537
"commander": "catalog:",

packages/springboard/cli/src/esbuild_plugins/esbuild_plugin_platform_inject.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,10 @@ export const esbuildPluginPlatformInject = (
2020

2121
// Early return if file doesn't need any transformations
2222
const hasPlatformAnnotations = /@platform "(node|browser|react-native|fetch)"/.test(source);
23-
const hasServerCalls = preserveServerStatesAndActions && /createServer(State|States|Action|Actions)/.test(source);
23+
const hasServerCalls = /createServer(State|States|Action|Actions)/.test(source);
24+
const needsServerProcessing = hasServerCalls && ((platform === 'browser' || platform === 'react-native') && !preserveServerStatesAndActions);
2425

25-
if (!hasPlatformAnnotations && !hasServerCalls) {
26+
if (!hasPlatformAnnotations && !needsServerProcessing) {
2627
return {
2728
contents: source,
2829
loader: args.path.split('.').pop() as 'js',
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import config from '../../../configs/vite.config';
2+
3+
export default config;

0 commit comments

Comments
 (0)