Socket
Socket
Sign inDemoInstall

next-transpile-modules

Package Overview
Dependencies
Maintainers
1
Versions
53
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

next-transpile-modules

Next.js plugin to transpile code from node_modules (supports TypeScript)


Version published
Weekly downloads
381K
decreased by-3.11%
Maintainers
1
Weekly downloads
 
Created

What is next-transpile-modules?

The next-transpile-modules package is a Next.js plugin that allows you to transpile code from node_modules. This is particularly useful when you are using third-party packages that are not pre-transpiled to ES5/ES6, or when you want to customize the build process for specific modules.

What are next-transpile-modules's main functionalities?

Transpile specific modules

This feature allows you to specify which modules from node_modules should be transpiled. This is useful for ensuring compatibility with older browsers or customizing the build process for specific modules.

const withTM = require('next-transpile-modules')(['some-module', 'and-another']);

module.exports = withTM({
  // Your Next.js config
});

Custom Babel configuration

You can customize the Babel configuration for the transpiled modules. This allows you to add specific Babel plugins or presets that are required for your project.

const withTM = require('next-transpile-modules')(['some-module']);

module.exports = withTM({
  babel: {
    presets: ['next/babel'],
    plugins: ['styled-components']
  }
});

Support for monorepos

The package supports monorepos by allowing you to transpile packages from a monorepo setup. This is useful for large projects that are split into multiple packages.

const withTM = require('next-transpile-modules')(['@my-scope/my-package']);

module.exports = withTM({
  // Your Next.js config
});

Other packages similar to next-transpile-modules

Keywords

FAQs

Package last updated on 17 May 2021

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