-
Notifications
You must be signed in to change notification settings - Fork 7
Description
Hello, first at all - thank you for your time you used to develop this plugin. Unfortunately today I spotted one problem when I was trying to use it "production" mode.
Generally on Windows environments DS is equal to "\" which should not be used in URLs which are produced by e.g. getLinkFromOutDirectory method.
Like mentioned above, DS is used in e.g. getLinkFromOutDirectory method from ManifestRecord class:
cakephp-vite/src/Utilities/ManifestRecord.php
Line 228 in 6028e07
| return $outDirectory . DS . $assetLink; |
to build path to assets like js or css files. This, on Windows, creates following, incorrect URLs like http://test.localhost/js/%5Cassets/main-5de7cc61.js which of course does not load.
Here is my cakephp-vite plugin configuration:
'ViteHelper' => [
'development' => [
'scriptEntries' => ['webroot_src/main.js'],
],
]Here is vite.confg.js I am using:
import {defineConfig} from 'vite'
export default defineConfig({
build: {
emptyOutDir: false,
outDir: './webroot',
manifest: true,
rollupOptions: {
input: './webroot_src/main.js',
},
},
server: {
port: 3000,
strictPort: true,
hmr: {
protocol: 'ws',
host: 'localhost',
},
},
});