Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@newstudios/next-less-loader

Package Overview
Dependencies
Maintainers
2
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@newstudios/next-less-loader

changed version for next-less

  • 1.0.0
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
2
Weekly downloads
 
Created
Source

next-less-loader

基于业务完善版本的 less loader for nextjs

差异

对比官方提供的 next-less,多了从 next.config.js 中读取了一个配置项 cssModulesExclude(数组类型)

配置方式

next.config.js 中的配置信息如下:

cssModulesExclude: [
  /node_modules/,
  /assets/
]

如果配置了(只要 cssModulesExclude 对应的数组值长度大于 0),next-less-loader 内部会关闭指定规则的 cssModules(设置 false

内部代码设计:

const globlaCssWithoutCssModuleLoader = cssLoaderConfig(config, {
  cssModules: false,
  ...
})

const globalLessWithoutCssModuleLoader = cssLoaderConfig(config, {
  cssModules: false,
  ...
})


config.module.rules.push({
  test: /\.less$/,
  include: cssModulesExclude,
  use: globalLessWithoutCssModuleLoader,
})

其他配置项:

  • cssModules
  • cssLoaderOptions
  • postcssLoaderOptions
  • lessLoaderOptions

依赖

Keywords

FAQs

Package last updated on 29 Jun 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc