@aegenet/ya-node-externals
v1.0.1
Published
Yet Another Node Externals
Downloads
84
Readme
@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
License
The MIT License - Copyright © 2024 Alexandre Genet.