@vituum/vite-plugin-latte 2.0.0-next.2 → 2.0.0-next.4
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/index.js +5 -6
- package/package.json +12 -13
package/index.js
CHANGED
|
@@ -3,13 +3,12 @@ import { fileURLToPath } from 'node:url'
|
|
|
3
3
|
import fs from 'node:fs'
|
|
4
4
|
import process from 'node:process'
|
|
5
5
|
import * as childProcess from 'node:child_process'
|
|
6
|
-
import
|
|
7
|
-
import { minimatch } from 'minimatch'
|
|
6
|
+
import picomatch from 'picomatch'
|
|
8
7
|
import {
|
|
9
8
|
getPackageInfo,
|
|
10
9
|
pluginError,
|
|
11
10
|
pluginReload,
|
|
12
|
-
|
|
11
|
+
deepMergeWith,
|
|
13
12
|
pluginBundle,
|
|
14
13
|
normalizePath,
|
|
15
14
|
pluginMiddleware,
|
|
@@ -57,7 +56,7 @@ const renderTemplate = ({ server, path, filename, cwd, packageRoot, viteServer }
|
|
|
57
56
|
if (options.data) {
|
|
58
57
|
const normalizePaths = Array.isArray(options.data) ? options.data.map(path => normalizePath(path)) : normalizePath(options.data)
|
|
59
58
|
|
|
60
|
-
options.data =
|
|
59
|
+
options.data = fs.globSync(normalizePaths).map(entry => resolve(cwd, entry))
|
|
61
60
|
}
|
|
62
61
|
|
|
63
62
|
Object.keys(options.filters).forEach((key) => {
|
|
@@ -97,7 +96,7 @@ const plugin = (options = {}) => {
|
|
|
97
96
|
let resolvedConfig
|
|
98
97
|
let userEnv
|
|
99
98
|
|
|
100
|
-
options =
|
|
99
|
+
options = deepMergeWith(defaultOptions, options)
|
|
101
100
|
|
|
102
101
|
const cwd = process.cwd()
|
|
103
102
|
const packageRoot = dirname((fileURLToPath(import.meta.url)))
|
|
@@ -143,7 +142,7 @@ const plugin = (options = {}) => {
|
|
|
143
142
|
transformIndexHtml: {
|
|
144
143
|
order: 'pre',
|
|
145
144
|
async handler(content, { path, filename, server }) {
|
|
146
|
-
if (options.ignoredPaths.find(ignoredPath =>
|
|
145
|
+
if (options.ignoredPaths.find(ignoredPath => picomatch(ignoredPath)(path.replace('.html', '')) === true)) {
|
|
147
146
|
return content
|
|
148
147
|
}
|
|
149
148
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vituum/vite-plugin-latte",
|
|
3
|
-
"version": "2.0.0-next.
|
|
3
|
+
"version": "2.0.0-next.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "types/index.d.ts",
|
|
@@ -14,19 +14,18 @@
|
|
|
14
14
|
"publish-next": "npm publish --tag next"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
"lodash": "^4.17",
|
|
20
|
-
"minimatch": "^10.1"
|
|
17
|
+
"picomatch": "^4.0.3",
|
|
18
|
+
"vituum": "^2.0.0-next.7"
|
|
21
19
|
},
|
|
22
20
|
"devDependencies": {
|
|
23
21
|
"@eslint/js": "^9.39",
|
|
24
|
-
"@stylistic/eslint-plugin": "^5.
|
|
22
|
+
"@stylistic/eslint-plugin": "^5.7",
|
|
25
23
|
"@types/node": "^25",
|
|
26
|
-
"
|
|
24
|
+
"@types/picomatch": "^4.0",
|
|
27
25
|
"eslint": "^9.39",
|
|
28
|
-
"globals": "^
|
|
29
|
-
"typescript": "^5.9"
|
|
26
|
+
"globals": "^17.0",
|
|
27
|
+
"typescript": "^5.9",
|
|
28
|
+
"vite": "^8.0.0-beta.8"
|
|
30
29
|
},
|
|
31
30
|
"files": [
|
|
32
31
|
"index.js",
|
|
@@ -38,13 +37,13 @@
|
|
|
38
37
|
"types"
|
|
39
38
|
],
|
|
40
39
|
"exports": {
|
|
41
|
-
".":
|
|
42
|
-
|
|
43
|
-
"types": "./types
|
|
40
|
+
".": {
|
|
41
|
+
"default": "./index.js",
|
|
42
|
+
"types": "./types/index.d.ts"
|
|
44
43
|
}
|
|
45
44
|
},
|
|
46
45
|
"engines": {
|
|
47
|
-
"node": "^
|
|
46
|
+
"node": "^24.0.0 || >=25.0.0"
|
|
48
47
|
},
|
|
49
48
|
"repository": {
|
|
50
49
|
"type": "git",
|