wuzekang / antd-theme

Provide runtime dynamic theme for ant design.
https://wuzekang.github.io/antd-theme
55 stars 14 forks source link

Unrecognized Input #3

Closed ojame closed 4 years ago

ojame commented 4 years ago

I'm integrating this with webpack, my config is:

rules: [
        {
          test: /\.less$/,
          use: [
            {
              loader: AntdThemePlugin.loader,
            },
            {
              loader: 'style-loader',
            },
            {
              loader: 'css-loader',
            },
            {
              loader: 'less-loader',
              options: {
                javascriptEnabled: true,
                modifyVars: antdVariables,
              },
            },
          ],
        },
        {
        test: /\.(js|jsx)$/,
        exclude: /node_modules/,
        use: [
          {
            loader: 'babel-loader',
            options: {
              plugins: [
                [
                  'import',
                  {
                    libraryName: 'antd',
                    style: true,
                  },
                ],
              ],
            },
          },
          'eslint-loader',
        ],
      },
      ],
    },
]

But I'm getting the following error when webpack builds:

var content = (function (module) {
          ^
Unrecognised input
wuzekang commented 4 years ago

Remove style-loader config

{
  loader: 'style-loader',
},

and you should be able to run