vite-plugin-pkl

0.1.1 • Public • Published

vite-plugin-pkl

npm version MIT License

PKL file import plugin for Vite.

Uses @pkl-community/node-packages package for parsing.

[!WARNING]

Install

npm install vite-plugin-pkl --save-dev

Add it in vite.config.js:

import pkl from 'vite-plugin-pkl'

export default {
  plugins: [
    pkl(),
    // ...other vite plugins
  ]
}

Options

plugins: [
  pkl({
    debug: true // default: false - Output before/after in Vite console.
  }),

Example

Import like a regular JSON file:

import test from './test.pkl'

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

Known issues

  • Some expressions need to be escaped with a backslash: "Hello, \(bird.name)!"
  • No Windows support yet.

Readme

Keywords

Package Sidebar

Install

npm i vite-plugin-pkl

Weekly Downloads

3

Version

0.1.1

License

MIT

Unpacked Size

3.89 kB

Total Files

4

Last publish

Collaborators

  • martinkruusement