I try to setup vite for my typo3 website thats running on ddev docker. "Npm run dev" and "npm run build" working fine in the console.
[npm run build] (https://i.stack.imgur.com/UM4eJ.jpg)
[npm run dev] (https://i.stack.imgur.com/cKtKR.jpg)
The Output is also saved correctly in Public/Vite/
Unfortunately my main.js can not be found. enter image description here
vite.config.js
export const config = {
target: 'es6',
outDir: 'packages/colin_frontend/Resources/Public/Vite/',
entry: 'src/js/main.js',
watchIncludes: './src/**/**/**/.js',
stylelint: {
include: ['./src/scss/**/*.scss'],
exclude: [
/node_modules/,
],
},
};
export const DDEV_HMR_PORT = 5173;
vite.website.js
import { defineConfig } from 'vite';
import vue from '@vitejs/plugin-vue';
export default defineConfig({
resolve: { alias: { '@': '/src' } },
plugins: [
vue(),
],
server: {
host: '0.0.0.0',
watch: {
usePolling: true
}
},
publicDir: false,
build: {
rollupOptions: {
input: 'src/js/main.js', // overwrite default .html entry
},
manifest: true, // generate manifest.json in outDir
outDir: 'packages/colin_frontend/Resources/Public/Vite/', // ⚠️ `pnpm build` purges outDir
},
css: {
devSourcemap: true, // disabled by default because of performance reasons
}
})
I don't really know where the problem lies. Hope you can help me. Thanks.