hannoeru / esbuild-plugin-raw

esbuild plugin for raw import
MIT License
16 stars 3 forks source link
esbuild raw tsup

esbuild-plugin-raw

Install

$ npm install -D esbuild-plugin-raw

Usage

With build script

import esbuild from 'esbuild'
import RawPlugin from 'esbuild-plugin-raw'

esbuild.build({
  entryPoints: ['app.js'],
  bundle: true,
  outfile: 'out.js',
  plugins: [RawPlugin],
}).catch(() => process.exit(1))

With tsup

import { defineConfig } from 'tsup'
import RawPlugin from 'esbuild-plugin-raw'

export default defineConfig({
  entryPoints: ['index.ts'],
  format: ['cjs', 'esm'],
  dts: true,
  esbuildPlugins: [RawPlugin()],
  clean: true,
})

License

MIT License © 2021 hannoeru