New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

xdw

Package Overview
Dependencies
Maintainers
0
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

xdw

Build a packager with bundle or run tsc directories, suitable for node|browser library package processing, It is implemented using esbuild

latest
npmnpm
Version
0.1.0-beta1
Version published
Maintainers
0
Created
Source

xdw

npm version

tsup is similar but focuses more on packet processing, powered by esbuild.

what's the difference?

  • A more casual package directory
  • carry meta options
  • carry assets options(.png, .html,...more)
  • more universal

⚙️ Install

Install it locally in your project folder:

pnpm add xdw --dev
# Or Yarn
yarn add xdw --dev

You can also install it globally but it's not recommended.

📖 Usage

Bundle files

xd [...file]

Files are written into ./dist.

You can bundle multiple files in one go:

xd src/index.ts src/bin/bin.ts

This will output dist/index.cjs.js; dist/index.esm.js and dist/bin.cjs.js; dist/bin.esm.js.

Unlike tsup, Xd is more suitable for a single independent entry file, Xd does not preserve the directory structure

build directory

xd [...directory]

Files are written into ./dist.

You can build dir in one go:

src
 - bin
   index.ts
 index.ts
xd src

This will output:

dist
 - bin
   index.js
 index.js

You can build multiple directories at once, but it is recommended to use only one directory as filename duplicates will be overwritten

carry meta

use command --meta It works well on some monorepo (pnpm,yarn,npm) applications

  • carry package info (LICENSE, README.md, CHANGELOG.md)
  • handle package.publishConfig and carry package.json
  • create node_modules lnk file to output(default dist)

Using custom configuration

Like tsup, you can use the config file to configure

Supported file formats

  • xdw.config.ts
  • xdw.config.js
  • xdw.config.cjs
  • xdw.config.json

TypeScript / JavaScript

import { defineConfig } from 'xdw';

export default defineConfig({
  entry: ['src/index.ts'],
  splitting: false,
  sourcemap: true,
  clean: true
});

carry assets

You can carry static resources that your project depends on

use command --assets aaa.png,xxx.vue,assetsDir

defines it like this in defineConfig

import { defineConfig } from 'xdw';

export default defineConfig({
  assets: ['aaa.png', 'xxx.vue', 'assetsDir']
});

Credits

hairyf/ptsup

Keywords

tsup

FAQs

Package last updated on 22 Aug 2024

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