@vituum/vite-plugin-pug 0.1.3 → 0.1.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.
Files changed (2) hide show
  1. package/index.js +4 -5
  2. package/package.json +4 -4
package/index.js CHANGED
@@ -51,8 +51,7 @@ const renderTemplate = async(filename, content, options) => {
51
51
  console.error(chalk.red(name + ' template must be defined - ' + filename))
52
52
  }
53
53
 
54
- context.template = relative(process.cwd(), context.template).startsWith(relative(process.cwd(), options.root))
55
- ? resolve(process.cwd(), context.template) : resolve(options.root, context.template)
54
+ context.template = relative(process.cwd(), context.template).startsWith(relative(process.cwd(), options.root)) ? resolve(process.cwd(), context.template) : resolve(options.root, context.template)
56
55
  } else if (fs.existsSync(filename + '.json')) {
57
56
  lodash.merge(context, JSON.parse(fs.readFileSync(filename + '.json').toString()))
58
57
  }
@@ -64,7 +63,7 @@ const renderTemplate = async(filename, content, options) => {
64
63
  }))
65
64
 
66
65
  output.content = template(context)
67
- } catch(error) {
66
+ } catch (error) {
68
67
  output.error = error
69
68
  }
70
69
 
@@ -111,13 +110,13 @@ const plugin = (options = {}) => {
111
110
  return
112
111
  }
113
112
 
114
- server.ws.send({
113
+ setTimeout(() => server.ws.send({
115
114
  type: 'error',
116
115
  err: {
117
116
  message: render.error.message,
118
117
  plugin: name
119
118
  }
120
- })
119
+ }), 50)
121
120
  }
122
121
 
123
122
  return render.content
package/package.json CHANGED
@@ -1,16 +1,16 @@
1
1
  {
2
2
  "name": "@vituum/vite-plugin-pug",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "type": "module",
5
5
  "main": "index.js",
6
6
  "dependencies": {
7
7
  "pug": "^3.0.2",
8
8
  "lodash": "^4.17.21",
9
- "chalk": "^5.0.1",
10
- "fast-glob": "^3.2.11"
9
+ "chalk": "^5.2.0",
10
+ "fast-glob": "^3.2.12"
11
11
  },
12
12
  "devDependencies": {
13
- "eslint": "^8.23.0",
13
+ "eslint": "^8.29.0",
14
14
  "eslint-config-standard": "^17.0.0"
15
15
  },
16
16
  "files": [