@vituum/vite-plugin-pug 1.0.0-beta.1 → 1.1.0
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/README.md +1 -1
- package/index.js +2 -5
- package/package.json +11 -11
- package/types/index.d.ts +2 -0
package/README.md
CHANGED
package/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import lodash from 'lodash'
|
|
|
4
4
|
import pug from 'pug'
|
|
5
5
|
import {
|
|
6
6
|
getPackageInfo,
|
|
7
|
-
merge,
|
|
7
|
+
merge,
|
|
8
8
|
pluginBundle,
|
|
9
9
|
pluginMiddleware,
|
|
10
10
|
pluginReload,
|
|
@@ -55,7 +55,6 @@ const renderTemplate = async ({ filename, server, resolvedConfig }, content, opt
|
|
|
55
55
|
})
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
-
context.template = normalizePath(context.template)
|
|
59
58
|
context.template = relative(resolvedConfig.root, context.template).startsWith(relative(resolvedConfig.root, options.root)) ? resolve(resolvedConfig.root, context.template) : resolve(options.root, context.template)
|
|
60
59
|
} else if (fs.existsSync(`${initialFilename}.json`)) {
|
|
61
60
|
lodash.merge(context, JSON.parse(fs.readFileSync(`${initialFilename}.json`).toString()))
|
|
@@ -99,8 +98,6 @@ const plugin = (options = {}) => {
|
|
|
99
98
|
|
|
100
99
|
if (!options.root) {
|
|
101
100
|
options.root = config.root
|
|
102
|
-
} else {
|
|
103
|
-
options.root = normalizePath(options.root)
|
|
104
101
|
}
|
|
105
102
|
},
|
|
106
103
|
buildStart: async () => {
|
|
@@ -119,7 +116,7 @@ const plugin = (options = {}) => {
|
|
|
119
116
|
},
|
|
120
117
|
transformIndexHtml: {
|
|
121
118
|
order: 'pre',
|
|
122
|
-
async
|
|
119
|
+
async handler (content, { path, filename, server }) {
|
|
123
120
|
return pluginTransform(content, { path, filename, server }, { name, options, resolvedConfig, renderTemplate })
|
|
124
121
|
}
|
|
125
122
|
},
|
package/package.json
CHANGED
|
@@ -1,24 +1,25 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vituum/vite-plugin-pug",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "index.js",
|
|
6
|
+
"types": "types/index.d.ts",
|
|
6
7
|
"scripts": {
|
|
7
8
|
"tsc": "tsc",
|
|
8
9
|
"eslint": "eslint '**/*.js' --fix"
|
|
9
10
|
},
|
|
10
11
|
"dependencies": {
|
|
11
|
-
"pug": "^3.0
|
|
12
|
-
"lodash": "^4.17
|
|
13
|
-
"fast-glob": "^3.
|
|
14
|
-
"vituum": "^1.
|
|
12
|
+
"pug": "^3.0",
|
|
13
|
+
"lodash": "^4.17",
|
|
14
|
+
"fast-glob": "^3.3",
|
|
15
|
+
"vituum": "^1.1"
|
|
15
16
|
},
|
|
16
17
|
"devDependencies": {
|
|
17
|
-
"@types/node": "^20.
|
|
18
|
-
"eslint": "^8.
|
|
18
|
+
"@types/node": "^20.9.1",
|
|
19
|
+
"eslint": "^8.53.0",
|
|
19
20
|
"eslint-config-standard": "^17.1.0",
|
|
20
|
-
"typescript": "^5.
|
|
21
|
-
"vite": "^
|
|
21
|
+
"typescript": "^5.2.2",
|
|
22
|
+
"vite": "^5.0.0"
|
|
22
23
|
},
|
|
23
24
|
"files": [
|
|
24
25
|
"index.js",
|
|
@@ -29,8 +30,7 @@
|
|
|
29
30
|
"./types": "./types/*"
|
|
30
31
|
},
|
|
31
32
|
"engines": {
|
|
32
|
-
"node": "
|
|
33
|
-
"npm": ">=9.0.0"
|
|
33
|
+
"node": "^18.0.0 || >=20.0.0"
|
|
34
34
|
},
|
|
35
35
|
"repository": {
|
|
36
36
|
"type": "git",
|