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

next-remove-imports

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

next-remove-imports

The default behavior is to remove all `.less`/`.css`/`.scss`/`.sass`/`.styl` imports from all packages in node_modules.

  • 1.0.12
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
16K
increased by14.67%
Maintainers
1
Weekly downloads
 
Created
Source

next-remove-imports

NPM Downloads Build & Deploy Repo Dependents

This is a plugin for nextjs. The default behavior is to remove all .less/.css/.scss/.sass/.styl imports from all packages in node_modules.

Warning CSS Imported by a Dependency #52

Install

npm install next-remove-imports
# or
yarn add next-remove-imports

Usage

// next.config.mjs
import removeImports from 'next-remove-imports'

/** @type {function(import("next").NextConfig): import("next").NextConfig}} */
const removeImportsFun = removeImports({
  // test: /node_modules([\s\S]*?)\.(tsx|ts|js|mjs|jsx)$/,
  // matchImports: "\\.(less|css|scss|sass|styl)$"
});

export default removeImportsFun({
  webpack(config, options) {
    return config
  },
});
// next.config.js
const removeImports = require('next-remove-imports')({
  options: { },
})
module.exports = removeImports()
// next.config.js
const removeImports = require('next-remove-imports')()
module.exports = removeImports({
  webpack(config, options) {
    return config
  },
});
// next.config.js
const removeImports = require('next-remove-imports')({
  test: /node_modules([\s\S]*?)\.(tsx|ts|js|mjs|jsx)$/,
  matchImports: "\\.(less|css|scss|sass|styl)$"
});

module.exports = removeImports({
  webpack(config, options) {
    return config
  },
});
// next.config.js
const removeImports = require('next-remove-imports')();

module.exports = (phase, { defaultConfig }) => {
  return removeImports({
    ...defaultConfig
  });
};

Options

export type PluginOptions = {
  /**
   * @default "/node_modules([\s\S]*?)\.(tsx|ts|js|mjs|jsx)$/"
   */
  test?: RegExp;
  /**
   * @default "\\.(less|css|scss|sass|styl)$"
   */
  matchImports?: string;
}

License

Licensed under the MIT License.

Keywords

FAQs

Package last updated on 01 Aug 2023

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