0.6.0 • Published 6 months ago

vite-plugin-toml v0.6.0

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

vite-plugin-toml

npm version automatic deploy MIT License

Toml file plugin for rollup/vite.

The name starts with vite-plugin-, but this is a historical reason. This plugin does support rollup too.

Uses toml-eslint-parser package for parsing. Supports Toml 1.0.0.

Install

npm i -D vite-plugin-toml # yarn add -D vite-plugin-toml

Add plugin in vite.config.js.

import { ViteToml } from 'vite-plugin-toml'

export default {
  plugins: [ViteToml()]
}

Options

  • namedExports (default: false)

Enable named exports.

Typescript

I recommend using typescript-plugin-toml.

Alternatively, add this global declaration.

declare module '*.toml' {
  const value: unknown
  export default value
}

Example

test.toml

key = 'value'

index.ts

import test from './test.toml'

console.log(test.key) // 'value'
0.6.0

6 months ago

0.5.0

1 year ago

0.4.0

2 years ago

0.3.2

2 years ago

0.3.3

2 years ago

0.3.1

3 years ago

0.3.0

3 years ago

0.2.0

3 years ago

0.1.1

3 years ago

0.1.0

3 years ago