@vituum/vite-plugin-pug 1.0.0-beta.1 → 1.0.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 () => {
package/package.json CHANGED
@@ -1,8 +1,9 @@
1
1
  {
2
2
  "name": "@vituum/vite-plugin-pug",
3
- "version": "1.0.0-beta.1",
3
+ "version": "1.0.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"
@@ -11,10 +12,10 @@
11
12
  "pug": "^3.0.2",
12
13
  "lodash": "^4.17.21",
13
14
  "fast-glob": "^3.2.12",
14
- "vituum": "^1.0.0-beta.3"
15
+ "vituum": "^1.0.0"
15
16
  },
16
17
  "devDependencies": {
17
- "@types/node": "^20.3.1",
18
+ "@types/node": "^20.3.2",
18
19
  "eslint": "^8.43.0",
19
20
  "eslint-config-standard": "^17.1.0",
20
21
  "typescript": "^5.1.3",
@@ -29,7 +30,7 @@
29
30
  "./types": "./types/*"
30
31
  },
31
32
  "engines": {
32
- "node": ">=18.0.0",
33
+ "node": ">=16.0.0",
33
34
  "npm": ">=9.0.0"
34
35
  },
35
36
  "repository": {
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