How to change the Vite Manifest directory
P粉034571623
P粉034571623 2023-08-26 21:22:38
0
2
443
<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>
P粉034571623
P粉034571623

reply all(2)
P粉450079266

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...

Filename: npm_run_build.bash
Contents: 
#!/bin/bash
npm run build
mv ./public_html/build/manifest.json ./public/build/manifest.json

Then I just run the command

"bash npm_run_build.bash"

Replace hte command

npm run build

It does the build and then moves the files to the desired location so I can run the script without any extra work...

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!