0.2.3 • Published 10 months ago

unplugin-dsv v0.2.3

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

unplugin-dsv

NPM version

šŸ£ A universal bundler plugin which converts .csv and .tsv files into JavaScript modules with d3-dsv.

Install

npm i unplugin-dsv
// vite.config.ts
import UnpluginDsv from 'unplugin-dsv/vite'

export default defineConfig({
  plugins: [
    UnpluginDsv({ /* options */ }),
  ],
})

Example: playground/

// rollup.config.js
import UnpluginDsv from 'unplugin-dsv/rollup'

export default {
  plugins: [
    UnpluginDsv({ /* options */ }),
  ],
}

// webpack.config.js
module.exports = {
  /* ... */
  plugins: [
    require('unplugin-dsv/webpack')({ /* options */ })
  ]
}

// nuxt.config.js
export default defineNuxtConfig({
  modules: [
    ['unplugin-dsv/nuxt', { /* options */ }],
  ],
})

This module works for both Nuxt 2 and Nuxt Vite

// vue.config.js
module.exports = {
  configureWebpack: {
    plugins: [
      require('unplugin-dsv/webpack')({ /* options */ }),
    ],
  },
}

// esbuild.config.js
import { build } from 'esbuild'
import UnpluginDsv from 'unplugin-dsv/esbuild'

build({
  plugins: [UnpluginDsv()],
})

Usage

Options

For all options please refer to docs.

This plugin accepts all @rollup/plugin-dsv options.

TypeScript

If you are using TypeScript, you need to add the following to your tsconfig.json file:

{
  "compilerOptions": {
    "types": [
      "unplugin-dsv/dsv-types"
    ]
  }
}
0.2.3

10 months ago

0.2.2

10 months ago

0.2.1

11 months ago

0.2.0

11 months ago