@vituum/vite-plugin-pug 0.1.1 → 0.1.2

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 +5 -2
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -80,6 +80,9 @@ const plugin = (options = {}) => {
80
80
  transformIndexHtml: {
81
81
  enforce: 'pre',
82
82
  async transform(content, { path, filename, server }) {
83
+ path = path.replace('?raw', '')
84
+ filename = filename.replace('?raw', '')
85
+
83
86
  if (
84
87
  !options.filetypes.html.test(path) &&
85
88
  !options.filetypes.json.test(path) &&
@@ -118,8 +121,8 @@ const plugin = (options = {}) => {
118
121
  },
119
122
  handleHotUpdate({ file, server }) {
120
123
  if (
121
- typeof options.reload === 'function' && options.reload(file) ||
122
- options.reload && (options.filetypes.html.test(file) || options.filetypes.json.test(file))
124
+ (typeof options.reload === 'function' && options.reload(file)) ||
125
+ (options.reload && (options.filetypes.html.test(file) || options.filetypes.json.test(file)))
123
126
  ) {
124
127
  server.ws.send({ type: 'full-reload' })
125
128
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vituum/vite-plugin-pug",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "type": "module",
5
5
  "main": "index.js",
6
6
  "dependencies": {