@aegenet/ya-node-externals
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

npm version Build Status codecov

@aegenet/ya-node-externals

Yet Another Node Externals

This library is useful to get the complete list of your dependencies.

💾 Installation

yarn add @aegenet/ya-node-externals@^1 -D
# or
npm i @aegenet/ya-node-externals@^1 --save-dev

📝 Usage

With Rollup

const { nodeExternals } = require('@aegenet/ya-node-externals');

export default async () => ({
  // [...]

  // make sure to externalize deps that shouldn't be bundled
  // into your library
  external: await nodeExternals(process.cwd()),
  // or for node package
  external: (await nodeExternals(process.cwd())).concat([/^node:/]),

  // [...]
});   

With Vite

import { defineConfig } from 'vite';
import { nodeExternals } from '@aegenet/ya-node-externals';

export default async defineConfig({
  // [...]
  build: {
    // [...]
    rollupOptions: {
      // [...]

      // make sure to externalize deps that shouldn't be bundled
      // into your library
      external: await nodeExternals(process.cwd()),
      // or for node package
      external: (await nodeExternals(process.cwd())).concat([/^node:/]),

      // [...]
    }
  }
  // [...]
});

Coverage

codecov

Coverage sunburst

Coverage tree

License

The MIT License - Copyright © 2024 Alexandre Genet.

Readme

Keywords

none

Package Sidebar

Install

npm i @aegenet/ya-node-externals

Weekly Downloads

5

Version

1.0.1

License

MIT

Unpacked Size

21.5 kB

Total Files

10

Last publish

Collaborators

  • agenet