#Vite building empty JS file

3 messages · Page 1 of 1 (latest)

soft wedge
#

Hey guys,

This issue's been absolutely bugging me but I've been trying to add a simple .js file to use in one of my templates. Here are the steps I've followed:

  1. Create pce.js (my chosen name) in resources/js/
  2. Add a function test(){ console.log('test'); }; into that file.
  3. Add @vite(['resources/js/pce.js']) to the top of my blade.php file
  4. Add "resources/js/pce.js" to the input section under my vite.config.js
  5. Run npm run build
  6. Get empty chunk output for pce.js (SS attached)

I don't know what on earth is going on. I've been googling for the past 15 minutes and can't find anything. Any help would be greatly appreciated.

#

And yes, it doesn't work in the browser either

#

debugger shows an empty file