How to change the Vite Manifest directory
P粉034571623
2023-08-26 21:22:38
<p>I want the vite manifest to be available in the public_html/build/ directory of my website, but I keep getting the error Vite manifest not found in: public_html/public/build/manifest.json. This is my config, how do I modify it so that it is at build/ instead of public/build ? </p>
<pre class="brush:php;toolbar:false;">//vite.config.js
export default defineConfig({
resolve: {
alias: {
'vue': 'vue/dist/vue.esm-bundler.js'
},
},
plugins: [
laravel({
input: ['resources/css/app.css', 'resources/js/app.js'],
refresh: true,
}),
vue({
template: {
transformAssetUrls: {
base: null,
includeAbsolute: false,
},
},
}),
VueI18nPlugin({
include: resolve(dirname(fileURLToPath(import.meta.url)), 'resources/js/locales/**'),
}),
],
build: {
outDir: 'build',
publicDir: 'build',
manifest: true,
}
});</pre></p>
I solved this problem by creating a bash file that runs the npm command, then moving the file to a public directory as needed. I run a command and it does everything I need easily with no extra work...
Then I just run the command
Replace hte command
It does the build and then moves the files to the desired location so I can run the script without any extra work...
I can't make my manfiest available in public_html/build, but I can leave all the compiled files there and move them to public/build and it works.