I have a problem with getting my mp3 files to work using the webpack file loader.
This is the issue:
I have a mp3 file on my harddisk, that if I open using c
My solution: install the file-loader. Update webpack.config.js:
// webpack.config.js rules: [ { test: /\.mp3$/, loader: 'file-loader', options: { name: '[path][name].[ext]' } }
Project.js :
const smthn = require('../sound.mp3'); const sound = new Audio('./sound.mp3'); (() => sound.play())();