1.0.7 • Published 1 month ago

bun-file-mover-plugin v1.0.7

Weekly downloads
-
License
MIT
Repository
github
Last release
1 month ago

File Mover Plugin

File mover plugin for bun.sh

Installation:

bun add bun-file-mover-plugin

Props

from

  • type: String
  • required: false
  • default: './src'

to

  • type: String
  • required: false
  • default: './build'

transform

  • type: Function
  • required: false

reqursive

  • type: Boolean
  • required: false
  • default: true

Usage example:

import Bun from 'bun';
import { FileMoverPlugin } from 'bun-file-mover-plugin';

const APP_LINK = 'https://any-site.com';

Bun.build({
  entrypoints: ['./src/index.ts'],
  outdir: './build',
  plugins: [
    FileMoverPlugin({
      from: './src/images',
      to: './build/images'
    }),
    FileMoverPlugin({
      from: './src/templates/',
      to: './build/templates',
      transform: (content: string) => {
        const regexp = new RegExp('{{APP_LINK}}', 'ig');
        return content.replace(regexp, APP_LINK);
      }
    })    
  ]
});
1.0.7

1 month ago

1.0.6

1 month ago

1.0.5

4 months ago

1.0.4

4 months ago

1.0.3

4 months ago

1.0.2

4 months ago

1.0.1

4 months ago

1.0.0

4 months ago