Why on earth (or in space) would you do that? A couple tons of chemical laboratory, and all you get is glucose.
A few hundred pounds of seed and fertilizers an you get sugars, starches, fiber, fuel, vitamins and oxygen. You get pasta, potatoes, tomatoes, cotton, peppers, corn, berries, salad greens, eventually fruits and nuts. and if for whatever reason, blueberries fail, its not a disaster, you still have strawberries, raspberries, blackberries, etc.
With your chemical factory all you get is sugar water, and if the equipment of any step of the process including the side steps making the chemical feedstocks breaks, you are done.
Weight = energy. Also, the system is vulnerable since the environment has to be earth-like = pressure, temperature, sunlight, artificial gravity, micrometorites, radiation, etc. etc. etc.
And it is not just glucose that might be produced but all nutrients and elements like oxygen to sustain a human.
Important point: human scientists can create a solution better than nature. Nature is inefficient. Example: a bird vs a fighter jet. Both can fly.