rolldown_plugin_vite_html 0.1.0

Rolldown plugin for Vite HTML handling
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use std::sync::LazyLock;

use regex::Regex;

pub const MODULE_PRELOAD_POLYFILL: &str = "vite/modulepreload-polyfill";

pub static INLINE_IMPORT: LazyLock<Regex> =
  LazyLock::new(|| Regex::new(r#"\bimport\s*\(("(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*')\)"#).unwrap());

pub static IMPORT_RE: LazyLock<Regex> =
  LazyLock::new(|| Regex::new(r#"\bimport\s*(?:"[^"]*[^\\]"|'[^']*[^\\]');*"#).unwrap());

pub static COMMENT_RE: LazyLock<Regex> =
  LazyLock::new(|| Regex::new(r"(?m)/\*[\s\S]*?\*/|//.*$").unwrap());