Skip to content

pYr0x/vite-plugin-stache

Folders and files

NameName
Last commit message
Last commit date

Latest commit

author
Julian Kern
Dec 19, 2022
36a3626 · Dec 19, 2022

History

17 Commits
May 5, 2022
Dec 19, 2022
Dec 19, 2022
Dec 19, 2022
May 5, 2022
Jan 6, 2022
Jan 6, 2022
Apr 9, 2021
May 5, 2022
May 5, 2022
Jan 6, 2022
Jan 6, 2022
Dec 19, 2022
Dec 19, 2022
Dec 19, 2022
Jan 6, 2022
May 5, 2022
Jan 6, 2022
May 5, 2022

Repository files navigation

vite-plugin-stache

vite-plugin-stache requires CanJS >= 6.x

Install

npm i vite-plugin-stache --save-dev

or

yarn add -D vite-plugin-stache

or

pnpm add -D vite-plugin-stache

Usage

Use the plugin in your Vite config (vite.config.ts)

All-in-one

import stachePlugins from 'vite-plugin-stache'

export default {
    plugins: [
      ...stachePlugins()
    ]
}

Plugins

The Vite-Stache plugin consists of several plugins.

  • Stache-Loader: Loads a .stache template file and converts it into a javascript module with the stache-ast for the template part.
  • Stache-Import: Within the .stache file you can import other files like (https://canjs.com/doc/can-view-import.html). This plugin handles static and dynamic import (ES2020 import()).
  • Stache-Inline-Converter (optional): Searching for a stache template string within javascript files and converts it into an AST.
import stachePlugins from 'vite-plugin-stache'

export default {
    plugins: [
      stachePlugins({inlineTransformation: false})
    ]
}