@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 CHANGED
@@ -38,5 +38,5 @@ or
38
38
 
39
39
  ### Requirements
40
40
 
41
- - [Node.js LTS (18.x)](https://nodejs.org/en/download/)
41
+ - [Node.js LTS (16.x)](https://nodejs.org/en/download/)
42
42
  - [Vite](https://vitejs.dev/)
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, normalizePath,
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 transform (content, { path, filename, server }) {
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.0.0-beta.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.2",
12
- "lodash": "^4.17.21",
13
- "fast-glob": "^3.2.12",
14
- "vituum": "^1.0.0-beta.3"
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.3.1",
18
- "eslint": "^8.43.0",
18
+ "@types/node": "^20.9.1",
19
+ "eslint": "^8.53.0",
19
20
  "eslint-config-standard": "^17.1.0",
20
- "typescript": "^5.1.3",
21
- "vite": "^4.3.9"
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": ">=18.0.0",
33
- "npm": ">=9.0.0"
33
+ "node": "^18.0.0 || >=20.0.0"
34
34
  },
35
35
  "repository": {
36
36
  "type": "git",
package/types/index.d.ts CHANGED
@@ -35,3 +35,5 @@ export interface PluginUserConfig {
35
35
  ignoredPaths?: string[]
36
36
  options?: PugOptions
37
37
  }
38
+
39
+ export default function plugin(options?: PluginUserConfig) : import('vite').Plugin