Closed rawbin- closed 1 month ago
Could you please provide a repo that can reproduce this issue, we need more details to locate the issue
It seems the js error occurs when we have this config, but the css error shows up always
It seems the js error occurs when we have this config, but the css error shows up always
This is truely caused by this define but I think it's not a bug. It works like #define
in C/C++, macro definitions are essentially macro substitutions, all keywords process.env
will be replaced with the value of itself. So the expression process.env = {};
will be replaced to a expr like { ...process.env } = {};
so a syntax error will be thrown.
It seems the js error occurs when we have this config, but the css error shows up always
This is truely caused by this define but I think it's not a bug. It works like
#define
in C/C++, macro definitions are essentially macro substitutions, all keywordsprocess.env
will be replaced with the value of itself. So the expressionprocess.env = {};
will be replaced to a expr like{ ...process.env } = {};
so a syntax error will be thrown.
What's the difference with vite? when I use vite to build, it works fine. But when migrated to farm, it is stuck.
We'll take a look
The css issue will be fixed in @farmfe/core@1.3.28. But define whole process.env
is not supported in farm, it's unsafe, you can use env config to specify the env you want to define
Steps to reproduce
pnpm install pnpm build
Reproduce link
https://github.com/rawbin-/farm-repro
What is actually happening?
System Info