0.1.1 • Published 1 year ago

vite-plugin-pkl v0.1.1

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

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.
0.1.1

1 year ago

0.1.0

1 year ago