xdw
TypeScript icon, indicating that this package has built-in type declarations

0.1.0-beta1 • Public • Published

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

Package Sidebar

Install

npm i xdw

Weekly Downloads

0

Version

0.1.0-beta1

License

MIT

Unpacked Size

41 kB

Total Files

28

Last publish

Collaborators

  • chandlerver5