@unocss/extractor-pug 0.14.2 → 0.15.2
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.js → index.cjs} +7 -7
- package/dist/index.mjs +6 -8
- package/package.json +6 -6
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const regexVueTemplate = /<template.*?lang=['"]pug['"][^>]*?>\n([\s\S]*?\n)<\/template>/gm;
|
|
3
4
|
function extractorPug() {
|
|
4
5
|
async function compile(code, id) {
|
|
5
|
-
const Pug = await
|
|
6
|
+
const Pug = await import('pug');
|
|
6
7
|
try {
|
|
7
8
|
return Pug.compile(code, { filename: id })();
|
|
8
|
-
} catch
|
|
9
|
+
} catch {
|
|
9
10
|
}
|
|
10
11
|
}
|
|
11
12
|
return {
|
|
@@ -17,7 +18,7 @@ function extractorPug() {
|
|
|
17
18
|
if (ctx.id.match(/\.pug$/) || ctx.id.match(/\?vue&type=template/)) {
|
|
18
19
|
try {
|
|
19
20
|
ctx.code = await compile(ctx.code, ctx.id) || ctx.code;
|
|
20
|
-
} catch
|
|
21
|
+
} catch {
|
|
21
22
|
}
|
|
22
23
|
} else if (ctx.id.match(/\.vue$/)) {
|
|
23
24
|
const matches = Array.from(ctx.code.matchAll(regexVueTemplate));
|
|
@@ -37,5 +38,4 @@ ${tail}`;
|
|
|
37
38
|
};
|
|
38
39
|
}
|
|
39
40
|
|
|
40
|
-
|
|
41
|
-
exports.default = extractorPug;
|
|
41
|
+
module.exports = extractorPug;
|
package/dist/index.mjs
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
var regexVueTemplate = /<template.*?lang=['"]pug['"][^>]*?>\n([\s\S]*?\n)<\/template>/gm;
|
|
1
|
+
const regexVueTemplate = /<template.*?lang=['"]pug['"][^>]*?>\n([\s\S]*?\n)<\/template>/gm;
|
|
3
2
|
function extractorPug() {
|
|
4
3
|
async function compile(code, id) {
|
|
5
|
-
const Pug = await import(
|
|
4
|
+
const Pug = await import('pug');
|
|
6
5
|
try {
|
|
7
6
|
return Pug.compile(code, { filename: id })();
|
|
8
|
-
} catch
|
|
7
|
+
} catch {
|
|
9
8
|
}
|
|
10
9
|
}
|
|
11
10
|
return {
|
|
@@ -17,7 +16,7 @@ function extractorPug() {
|
|
|
17
16
|
if (ctx.id.match(/\.pug$/) || ctx.id.match(/\?vue&type=template/)) {
|
|
18
17
|
try {
|
|
19
18
|
ctx.code = await compile(ctx.code, ctx.id) || ctx.code;
|
|
20
|
-
} catch
|
|
19
|
+
} catch {
|
|
21
20
|
}
|
|
22
21
|
} else if (ctx.id.match(/\.vue$/)) {
|
|
23
22
|
const matches = Array.from(ctx.code.matchAll(regexVueTemplate));
|
|
@@ -36,6 +35,5 @@ ${tail}`;
|
|
|
36
35
|
}
|
|
37
36
|
};
|
|
38
37
|
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
};
|
|
38
|
+
|
|
39
|
+
export { extractorPug as default };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unocss/extractor-pug",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.15.2",
|
|
4
4
|
"description": "UnoCSS extractor for Pug",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"unocss",
|
|
@@ -22,11 +22,11 @@
|
|
|
22
22
|
"sideEffects": false,
|
|
23
23
|
"exports": {
|
|
24
24
|
".": {
|
|
25
|
-
"require": "./dist/index.
|
|
25
|
+
"require": "./dist/index.cjs",
|
|
26
26
|
"import": "./dist/index.mjs"
|
|
27
27
|
}
|
|
28
28
|
},
|
|
29
|
-
"main": "./dist/index.
|
|
29
|
+
"main": "./dist/index.cjs",
|
|
30
30
|
"module": "./dist/index.mjs",
|
|
31
31
|
"types": "./dist/index.d.ts",
|
|
32
32
|
"files": [
|
|
@@ -42,11 +42,11 @@
|
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@types/pug": "^2.0.5",
|
|
45
|
-
"@unocss/core": "0.
|
|
45
|
+
"@unocss/core": "0.15.2",
|
|
46
46
|
"pug": "^3.0.2"
|
|
47
47
|
},
|
|
48
48
|
"scripts": {
|
|
49
|
-
"build": "
|
|
50
|
-
"
|
|
49
|
+
"build": "unbuild",
|
|
50
|
+
"stub": "unbuild --stub"
|
|
51
51
|
}
|
|
52
52
|
}
|