UNPKG

@eclipsefdn/create-revealjs-solstice

Version:

Create starter template for revealjs-solstice

48 lines (45 loc) 1.59 kB
import { defineConfig } from "vite"; import { viteStaticCopy } from "vite-plugin-static-copy"; import { createAsciidoc, createWebsiteConfig, createRevealjsConfig, } from "@eclipsefdn/vite-plugin-asciidoctor"; export default defineConfig({ plugins: [ /** * Since aciidoctor-reveal.js is creating a script tag to load the reveal.js library, * we need to ensure that the reveal.js assets are available in the final build output, * since this type of reference cannot be processed by Vite. * * Here we are using `vite-plugin-static-copy` to copy the entire reveal.js package */ viteStaticCopy({ targets: [ { src: "node_modules/reveal.js/**/*", dest: "reveal.js", }, ], }), /** * Converts AsciiDoc files to HTML for both reveal.js and a standard deck. * * @remarks Here you could really define as many Asciidoctor configurations * as you want. Using any backend that will output HTML should work fine. */ createAsciidoc( createRevealjsConfig({ files: "slides/**/*.adoc", baseDir: "slides", // this is important since by default asciidoctor will use the current // working directory, meaning that references to docinfo files, images, etc. would need to be // relative to the root of the project revealjsDir: "/reveal.js", // this is relative to the reveal.js copy destination defined above }), createWebsiteConfig({ files: "slides/**/*.adoc", baseDir: "slides", }) ), ], });