vite-plugin-php 1.0.61 → 1.0.62

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
@@ -22,6 +22,7 @@ Check out the [starter repo](https://github.com/nititech/php-vite-starter) for a
22
22
 
23
23
  | Version | Feature |
24
24
  | ------- | ----------------------------------------------------------------------------------------------------------- |
25
+ | 1.0.62 | HTML transforms are now only applied to HTML contents during dev |
25
26
  | 1.0.60 | Fixed inline module transpiling -> PHP code is being properly inserted into transpiled inline module chunks |
26
27
  | 1.0.55 | Fixed pure PHP file processing |
27
28
  | 1.0.50 | Using native Rollup pipeline to generate bundle -> proper error messages during build |
package/dist/index.cjs CHANGED
@@ -7124,11 +7124,14 @@ function usePHP(cfg = {}) {
7124
7124
  }
7125
7125
  ).on("error", reject).end();
7126
7126
  });
7127
- const out = await server.transformIndexHtml(
7128
- requestUrl,
7129
- phpResult.content,
7130
- "/" + entryPathname
7131
- );
7127
+ let out = phpResult.content;
7128
+ if (phpResult.headers["content-type"]?.includes("html")) {
7129
+ out = await server.transformIndexHtml(
7130
+ requestUrl,
7131
+ out,
7132
+ "/" + entryPathname
7133
+ );
7134
+ }
7132
7135
  res.writeHead(phpResult.statusCode || 200, {
7133
7136
  ...req.headers,
7134
7137
  ...phpResult.headers
package/dist/index.mjs CHANGED
@@ -7110,11 +7110,14 @@ function usePHP(cfg = {}) {
7110
7110
  }
7111
7111
  ).on("error", reject).end();
7112
7112
  });
7113
- const out = await server.transformIndexHtml(
7114
- requestUrl,
7115
- phpResult.content,
7116
- "/" + entryPathname
7117
- );
7113
+ let out = phpResult.content;
7114
+ if (phpResult.headers["content-type"]?.includes("html")) {
7115
+ out = await server.transformIndexHtml(
7116
+ requestUrl,
7117
+ out,
7118
+ "/" + entryPathname
7119
+ );
7120
+ }
7118
7121
  res.writeHead(phpResult.statusCode || 200, {
7119
7122
  ...req.headers,
7120
7123
  ...phpResult.headers
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vite-plugin-php",
3
- "version": "1.0.61",
3
+ "version": "1.0.62",
4
4
  "author": "Nikita 'donnikitos' Nitichevski <me@donnikitos.com> (https://donnikitos.com/)",
5
5
  "repository": {
6
6
  "type": "git",