Socket
Socket
Sign inDemoInstall

next-compose-plugins

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

next-compose-plugins

Provides a cleaner API for enabling and configuring plugins for next.js


Version published
Maintainers
1
Created

What is next-compose-plugins?

The next-compose-plugins npm package is a utility for Next.js that allows you to compose multiple plugins into a single configuration. This makes it easier to manage and apply multiple plugins to your Next.js project in a clean and organized manner.

What are next-compose-plugins's main functionalities?

Compose Multiple Plugins

This feature allows you to combine multiple Next.js plugins into a single configuration. In this example, the withCSS and withSass plugins are composed together.

const withPlugins = require('next-compose-plugins');
const withCSS = require('@zeit/next-css');
const withSass = require('@zeit/next-sass');

module.exports = withPlugins([
  [withCSS],
  [withSass]
]);

Conditional Plugin Usage

This feature allows you to conditionally apply plugin configurations based on environment variables or other conditions. In this example, source maps for Sass are enabled only in non-production environments.

const withPlugins = require('next-compose-plugins');
const withCSS = require('@zeit/next-css');
const withSass = require('@zeit/next-sass');

const isProd = process.env.NODE_ENV === 'production';

module.exports = withPlugins([
  [withCSS, { cssModules: true }],
  [withSass, { sassLoaderOptions: { sourceMap: !isProd } }]
]);

Custom Plugin Configuration

This feature allows you to pass custom configurations to each plugin. In this example, custom options are provided for both the CSS and Sass loaders.

const withPlugins = require('next-compose-plugins');
const withCSS = require('@zeit/next-css');
const withSass = require('@zeit/next-sass');

module.exports = withPlugins([
  [withCSS, { cssLoaderOptions: { url: false } }],
  [withSass, { sassLoaderOptions: { includePaths: ['./styles'] } }]
]);

Other packages similar to next-compose-plugins

Keywords

FAQs

Package last updated on 09 Nov 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