Skip to content
This repository has been archived by the owner on Mar 24, 2023. It is now read-only.

using craco with antd-theme #7

Open
realjesset opened this issue Jul 10, 2020 · 1 comment
Open

using craco with antd-theme #7

realjesset opened this issue Jul 10, 2020 · 1 comment

Comments

@realjesset
Copy link

realjesset commented Jul 10, 2020

I use craco to use antd, and I am issues using this plugin. I keep getting a could not find a declaration file for module './runtime' in 'antd-theme/lib/index.tsx(8,8)'.

here's my craco config file:

const CracoLessPlugin = require("craco-less");
const {
    getThemeVariables
} = require('antd/dist/theme');
const AntdThemePlugin = require('antd-theme/plugin');

module.exports = {
    plugins: [{
        plugin: CracoLessPlugin,
        options: {
            lessLoaderOptions: {
                lessOptions: {
                    modifyVars: {
                        "@primary-color": "#1DA57A",
                        // ...getThemeVariables({
                        //     dark: true,
                        //     compact: true
                        // })
                    },
                    javascriptEnabled: true
                }
            }
        }
    }],
    webpack: {
        plugins: [new AntdThemePlugin({
            // Variables declared here can be modified at runtime
            variables: ['primary-color'],
            themes: [{
                    name: 'dark',
                    filename: require.resolve('antd/lib/style/themes/dark.less'),
                },
                {
                    name: 'compact',
                    filename: require.resolve('antd/lib/style/themes/compact.less'),
                },
            ],
        })]
    }
};
@rafaelncarvalho
Copy link

Any news about this?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants