Socket
Socket
Sign inDemoInstall

rollup-plugin-extensions

Package Overview
Dependencies
1
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

rollup-plugin-extensions

Allow rollup to resolve local files with any extension


Version published
Weekly downloads
149
decreased by-5.1%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

rollup-plugin-extensions

Allow rollup to resolve local files with any extension.

Installation

yarn add -D rollup-plugin-extensions

Usage

// rollup.config.js
import extensions from 'rollup-plugin-extensions';

export default {
  input: 'main.js',
  output: {
    file: 'bundle.js',
    format: 'cjs',
  },
  plugins: [
    extensions({
      // Supporting Typescript files
      // Uses ".mjs, .js" by default
      extensions: ['.tsx', '.ts', '.jsx', '.js'],
      // Resolves index dir files based on supplied extensions
      // This is enable by default
      resolveIndex: true,
    })
  ]
};

Why

Plugins like rollup-plugin-node-resolve can cause issues, if you're building a package, by trying to resolve files in node_modules.
This package strives to have a minimal use case and is primarily focused on adding extension support.

If you need additional features like aliasing, commonjs support, or fully supported nodejs style resolutions try these packages:

Todo

  • - Testing Suite

"Inspired" by Oskar

Keywords

FAQs

Last updated on 12 Mar 2019

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc