solid-start
solid-start copied to clipboard
[Bug?]: unplugin-macros doesn't work
Duplicates
- [x] I have searched the existing issues
Latest version
- [x] I have tested the latest version
Current behavior 😯
lib/test.ts:
export function getRandom() {
return Math.random();
}
export const buildTime = Date.now();
routes/test.ts:
import { buildTime, getRandom } from "../lib/test.ts" with { type: "macro" };
export function GET() {
return getRandom();
}
console.log(buildTime);
when you go to /test you'll see a different value every time.
Expected behavior 🤔
its supposed to be the same value every time, since its a macro.
config:
import Macros from "unplugin-macros/vite";
import { defineConfig } from "@solidjs/start/config";
export default defineConfig({
vite: {
plugins: [Macros()],
},
});
Steps to reproduce 🕹
i couldn't reproduce in vinxi. this bug is only in solidstart.
Context 🔦
No response
Your environment 🌎