vite-plugin-php 1.0.60 → 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
@@ -7154,6 +7157,8 @@ function usePHP(cfg = {}) {
7154
7157
  config
7155
7158
  }).write(outputFile);
7156
7159
  server.moduleGraph.invalidateAll();
7160
+ }
7161
+ if (entry2 || !file.startsWith(require$$0$1.resolve(tempDir)) && file.includes(".php")) {
7157
7162
  server.ws.send({
7158
7163
  type: "full-reload"
7159
7164
  });
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
@@ -7140,6 +7143,8 @@ function usePHP(cfg = {}) {
7140
7143
  config
7141
7144
  }).write(outputFile);
7142
7145
  server.moduleGraph.invalidateAll();
7146
+ }
7147
+ if (entry2 || !file.startsWith(resolve(tempDir)) && file.includes(".php")) {
7143
7148
  server.ws.send({
7144
7149
  type: "full-reload"
7145
7150
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vite-plugin-php",
3
- "version": "1.0.60",
3
+ "version": "1.0.62",
4
4
  "author": "Nikita 'donnikitos' Nitichevski <me@donnikitos.com> (https://donnikitos.com/)",
5
5
  "repository": {
6
6
  "type": "git",