Skip to content

style is broken on build but works on dev env #103

Description

@shereen-fathy

Hi there I'm trying to use this plugin in my project
I'm using

1. "next": "^10.0.5"
2. "antd": "^4.16.0"
3. "next-plugin-antd-less": "^1.8.0"
4. "less": "^4.1.2"

and here is my next config file

const withPlugins = require("next-compose-plugins");
const { getThemeVariables } = require("antd/dist/theme");
const lessToJS = require("less-vars-to-js");
const fs = require("fs");
const path = require("path");

// antd custom variables
const themeVariables = lessToJS(
  fs.readFileSync(
    path.resolve(__dirname, "./styles/antd-variables.less"),
    "utf8"
  )
);
const antdLessConfig = {
  modifyVars: {
    ...getThemeVariables({
      dark: true, // Enable dark mode
    }),
    ...themeVariables,
  },
  webpack(config) {
    return config;
  },
};
module.exports = withPlugins([[withAntdLess, antdLessConfig]]);

Everything is working fine on running yarn dev
image
but on run yarn build then yarn start I found the style is broken
image
all the styles i added is not used

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions