vite-plugin-php 1.0.8 → 1.0.9

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/dist/index.cjs CHANGED
@@ -34,7 +34,7 @@ function escapePHP(inputFile, outputFile) {
34
34
  const codeTokens = {};
35
35
  const isJS = inputFile.includes(".js") || inputFile.includes(".ts");
36
36
  const isML = inputFile.includes(".php") || inputFile.includes(".htm");
37
- const out = input.replaceAll(/<\?(?:php|).+?\?>/gis, (match) => {
37
+ const out = input.replace(/<\?(?:php|).+?(\?>|$)/gis, (match) => {
38
38
  let token = makeID();
39
39
  if (isJS) {
40
40
  token = `/*${token}*/`;
package/dist/index.mjs CHANGED
@@ -21,7 +21,7 @@ function escapePHP(inputFile, outputFile) {
21
21
  const codeTokens = {};
22
22
  const isJS = inputFile.includes(".js") || inputFile.includes(".ts");
23
23
  const isML = inputFile.includes(".php") || inputFile.includes(".htm");
24
- const out = input.replaceAll(/<\?(?:php|).+?\?>/gis, (match) => {
24
+ const out = input.replace(/<\?(?:php|).+?(\?>|$)/gis, (match) => {
25
25
  let token = makeID();
26
26
  if (isJS) {
27
27
  token = `/*${token}*/`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vite-plugin-php",
3
- "version": "1.0.8",
3
+ "version": "1.0.9",
4
4
  "description": "Precompile PHP-files with the speed of Vite",
5
5
  "keywords": [
6
6
  "vite",