Issue resolved. Problem existed between the chair and keyboard. Vite requires es6 modules and I had used non-es6 compliant javascript.
Generated an empty chunk:
When running npm run build within a Laravel 10 project, most of my js files listed in the vite.config.js compile as expected, yet several result in the following output: Generated an empty chunk: "".
They do appear in the manifest and they do exist in the final asset folder, yet they are empty. The original file is not empty, contains code the website needs/references in one or more blade files.
partial vite.config.js
plugins: [
laravel({
input: [
'resources/css/app.css',
'resources/js/app.js',
'resources/js/common/common.js',
'resources/js/common/moment.js',
'resources/js/public/bikerequest.js',
'resources/js/warehouse/outgoing.js',
'resources/js/warehouse/incoming.js',
Moment.js, outgoing.js, and incoming.js work as expected. bikerequest.js and common.js result in empty chunks.
Any idea on causes and possible solutions? I've found nothing within the Laravel docs, nor the vite docs.
Please or to participate in this conversation.