🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
Socket

@enonic/tsup-plugin-manifest

Package Overview
Dependencies
Maintainers
4
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@enonic/tsup-plugin-manifest

Plugin for tsup to generate a manifest.json per format

latest
Source
npmnpm
Version
0.0.1
Version published
Maintainers
4
Created
Source

tsup-plugin-manifest

Installation

npm install --save-dev @enonic/tsup-plugin-manifest
yarn add --dev @enonic/tsup-plugin-manifest
pnpm add --save-dev @enonic/tsup-plugin-manifest

Usage

import TsupPluginManifest from '@enonic/tsup-plugin-manifest';

export default defineConfig((options) => {
    return {
        // ...
        esbuildPlugins: [
            TsupPluginManifest({
                // Manipulate the manifest keys and values.
                generate: (entries) => {
                    const newEntries = {} as typeof entries;
                    Object.entries(entries).forEach(([k,v]) => {
                        // console.log(k,v);
                        const ext = v.split('.').pop() as string;
                        const parts = k.replace(`${SOME_DIR}/`, '').split('.');
                        parts.pop();
                        parts.push(ext);
                        newEntries[parts.join('.')] = v.replace(`${SOME_DIR}/`, '');
                    });
                    return newEntries;
                }
            })
        ],
        format: [
            'cjs', // Legacy browser support, also css in manifest.cjs.json
            'esm', // cjs needed because css files are not reported in manifest.esm.json
        ],
        // ...
    }
}

Release

git tag vX.Y.Z
git push origin vX.Y.Z

This will trigger release & publish on NPM.

Options

options?.generate

Type: (entries: Record<string,string>) => Record<string,string>

Callback used to manipulate the content of the produced manifest file.

License

MIT

Keywords

tsup

FAQs

Package last updated on 29 Aug 2023

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