phpcoder / vite-php

A Minimalistic Vite 4 Boilerplate to be used in your next PHP project. Create your PHP pages with power of Vite accelerated development with JS/CSS/SCSS.
https://phpcoder.github.io/vite-php/
MIT License
3 stars 1 forks source link

Including all PHP sources #1

Open ipekli opened 6 months ago

ipekli commented 6 months ago

Hi, I'm attempting to use a wildcard to encompass all PHP source files through a proxy, but this method has been unsuccessful. Is there a way to achieve this without having to explicitly specify each file name in the proxy settings?

export default defineConfig({
  plugins: [liveReload([__dirname + "/**/*.php"])],
  server: {
    proxy: {
      "/**/*.php": {
        target: "http://localhost.lo/src/assets/",
        changeOrigin: true,
        secure: false,
      },
    },
  },
phpcoder commented 6 months ago

Unfortunately, I am not aware of such an option of vite, neither of vite 4, nor vite 5. For a few PHP scripts this is not an issue. If you have a lot of PHP sources, maybe better to choose another PHP API design pattern, or look into web server config options.