@unocss/extractor-pug 0.51.12 → 0.51.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1,11 +1,11 @@
1
1
  'use strict';
2
2
 
3
3
  const regexVueTemplate = /<template.*?lang=['"]pug['"][^>]*?>\s*([\s\S]*?\s*)<\/template>/gm;
4
- function extractorPug() {
4
+ function extractorPug(options = {}) {
5
5
  async function compile(code, id) {
6
6
  const Pug = await import('pug');
7
7
  try {
8
- return Pug.compile(code, { filename: id })();
8
+ return Pug.compile(code, { filename: id, doctype: "html", ...options })();
9
9
  } catch {
10
10
  }
11
11
  }
package/dist/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import { Extractor } from '@unocss/core';
2
+ import { Options } from 'pug';
2
3
 
3
- declare function extractorPug(): Extractor;
4
+ declare function extractorPug(options?: Options): Extractor;
4
5
 
5
6
  export { extractorPug as default };
package/dist/index.mjs CHANGED
@@ -1,9 +1,9 @@
1
1
  const regexVueTemplate = /<template.*?lang=['"]pug['"][^>]*?>\s*([\s\S]*?\s*)<\/template>/gm;
2
- function extractorPug() {
2
+ function extractorPug(options = {}) {
3
3
  async function compile(code, id) {
4
4
  const Pug = await import('pug');
5
5
  try {
6
- return Pug.compile(code, { filename: id })();
6
+ return Pug.compile(code, { filename: id, doctype: "html", ...options })();
7
7
  } catch {
8
8
  }
9
9
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unocss/extractor-pug",
3
- "version": "0.51.12",
3
+ "version": "0.51.13",
4
4
  "description": "UnoCSS extractor for Pug",
5
5
  "author": "Anthony Fu <anthonyfu117@hotmail.com>",
6
6
  "license": "MIT",
@@ -44,7 +44,7 @@
44
44
  "devDependencies": {
45
45
  "@types/pug": "^2.0.6",
46
46
  "pug": "^3.0.2",
47
- "@unocss/core": "0.51.12"
47
+ "@unocss/core": "0.51.13"
48
48
  },
49
49
  "scripts": {
50
50
  "build": "unbuild",