Skip to content

Commit 41688f5

Browse files
committed
fix env vars transform
1 parent d3e7286 commit 41688f5

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ If you're using Vite with SolidJS, you can use the `statebuilder` custom plugin,
8888

8989
```ts
9090
import { defineConfig } from 'vite';
91-
import { statebuilder } from 'statebuilder/vite';
91+
import { statebuilder } from 'statebuilder/compiler';
9292

9393
export default defineConfig({
9494
// your vite config

packages/state/compiler/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export function statebuilder(options?: StateBuilderPluginOptions): Plugin[] {
4949
isDev = options?.dev ?? command === 'serve';
5050
return {
5151
define: {
52-
__STATEBUILDER_DEV__: isDev,
52+
'import.meta.env.STATEBUILDER_DEV': isDev,
5353
},
5454
plugins,
5555
};

packages/state/src/dev.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import type { Container } from './container';
22
import { isServer } from 'solid-js/web';
33

4-
// @ts-expect-error This type will not be exported
5-
export const $SB_DEV = __STATEBUILDER_DEV__ || false;
4+
export const $SB_DEV = import.meta.env.STATEBUILDER_DEV || false;
65

76
const containers: Container[] = [];
87
const statebuilder = {

0 commit comments

Comments
 (0)