SolidZORO / next-plugin-antd-less

🎩 Use Antd (Less) with Next.js v12, Zero Dependency on other Next-Plugins.
MIT License
345 stars 48 forks source link

Build time and hot reload are very slow #75

Closed mantovanig closed 2 years ago

mantovanig commented 2 years ago

Hi,

I'm using next-plugin-antd-less with the same stack of mkn but I have some problem with build performance.

In dev mode the hot reload is very slow and time consuming. The production build also take a lot of time.

I tried to investigate using @next/bundle-analyzer but I didn't find anything.

These are my configurations:

"antd": "4.16.13",
"next": "11.1.0",
"next-plugin-antd-less": "1.4.2",

babel.config.js

module.exports = function (api) {
    api.cache(true);

    return {
        presets: [['next/babel']],
        plugins: [
            ['import', { libraryName: 'antd', style: false }],
            ['module-resolver', { alias: { '@': './src' } }],
            ['add-react-displayname'],
        ],
    };
};

next.config.js

const withAntdLess = require('next-plugin-antd-less');

module.exports = withAntdLess({
    pageExtensions: ['page.tsx', 'api.ts'],
    reactStrictMode: true,
    lessVarsFilePath: './src/styles/variables.less',

    webpack(config) {
        return config;
    },
});

Any suggestions? Thanks

SolidZORO commented 2 years ago

There are many possibilities. I haven't used next.js for development for a long time. Next.js itself has many strange problems, and I mainly use this plugin for CRA... so I can't give you any suggestions.

mantovanig commented 2 years ago

Ok! Thanks anyway! 👍🏻

newtonmunene99 commented 2 years ago

@mantovanig did you happen to find any way to optimize this?