I am getting the following error from Webpack:
ERROR in ./resources/assets/js/data/vehicles.json.js
Module build failed: Error: ENOENT: no such file or directory, open '/Users/path-to-my-app/resources/assets/js/data/vehicles.json.js'
I'm not surprised that the file fails to load. The JSON file is not called vehicles.json.js. It is called vehicles.json.
The line where the file is imported reads:
import vehicleTypes from '../data/vehicles.json'
However, if I change the filename to vehicles.js (and use an export ststement to make it a module) and change the import statement to read:
import vehicleTypes from '../data/vehicles.js'
Webpack works fine.
I was under the impression that the latest webpack could load JSON files without configuring anything.