Рассмотрим следующие файлы: < /p>
Код: Выделить всё
// utils/index.js
export const funcA = () => {
return "funcA in CompA";
};
export const funcB = () => {
return "funcB in CompB";
};
< /code>
// components/ComponentA.js
import { funcA } from "@/utils";
export const ComponentA = () => {
return funcA();
};
< /code>
// components/ComponentB.js
import { funcB } from "@/utils";
export const ComponentB = () => {
return funcB();
};
< /code>
Also ComponentAЯ разместил «sideefcects»: false В моем пакете. Также я добавил эти конфигурации WebPack: < /p>
const nextConfig = {
webpack: (config, { isServer }) => {
config.optimization.splitChunks.chunks = "all";
return config;
},
};
< /code>
None of this has helped.
Can anyone please guide me what is the problem and how can i fix it?
Подробнее здесь: https://stackoverflow.com/questions/794 ... ared-files
Мобильная версия