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

Feature: Can I add sideEffects = true ? #34

Closed loyep closed 3 years ago

loyep commented 3 years ago
  // clone
  const lessModule = clone(sassModule);
  lessModule.test = /\.less$/;
  delete lessModule.issuer;
  lessModule.sideEffects = true;

sideEffect can make use import not require the global less.

SolidZORO commented 3 years ago

you say tree-shaking?

SolidZORO commented 3 years ago

You can control the sideEffects in the project's package.json and should not control them in the loader. If you want to import "global" styles, just use the abc.less name, not abc.module.less. Or use this in abc.module.less

.xyz { }

:global(.abc) { } // <---- global style