Can I suggest you use the public directory, and just symlink it to the public_html folder
Jul 10, 2022
4
Level 1
Set vite public path
Hi everyone, I am trying to migrate my webpack-bundled assets into vite (just like in new Laravel 9.19 projects). But, I am struggled to set the public path to other than default's public/ into public_html/. In webpack, I can use this:
mix.setPublicPath('public_html/');
how can I achieve it in vite?
import { defineConfig } from 'vite';
import laravel from 'laravel-vite-plugin';
export default defineConfig({
plugins: [
laravel({
input: [
'resources/css/app.css',
'resources/css/main.css',
'resources/js/app.js',
'resources/js/main.js',
],
publicDir: 'public_html/'
}),
],
});
Level 1
@Sinnbeck Idk if it's going to work to my server that using public_html instead of public. But I think I've already find out on previous discussion: https://laracasts.com/discuss/channels/vite/viteconfigjs-or-configvitephp?page=1&replyId=809235
import { defineConfig } from 'vite';
import laravel from 'laravel-vite-plugin';
export default defineConfig({
build: {
outDir: './public_html/build/'
},
plugins: [
laravel([
'resources/css/app.css',
'resources/css/main.css',
'resources/js/app.js',
'resources/js/main.js',
]),
]
});
Please or to participate in this conversation.