I am using webpack to build a basic site. Everything is working as far as images, sass, and loading of local fonts goes. I am now trying to load video from a local file however when i go to add it webpack is giving me a 404 error. Can anyone help me with my configuration since it seems I have it wrong for video. The video controls render but the video itself doesn't.
HTML code
<video controls width="600">
<source src="./assets/images/hero_vid_bg_1.mp4" type="video/mp4">
Sorry, your browser doesn't support embedded videos.
</video>
Webpack Config file
module.exports = {
entry: {
main: "./src/index.js"
},
module: {
rules: [
{
test: /\.html$/,
use: ["html-loader"]
},
{
test: /\.(svg|png|jpg|gif|)$/,
use: [{
loader: "file-loader",
options: {
name: "[name].[hash].[ext]",
outputPath: "./assets/images"
}
}]
},
{
test: /\.(woff|woff2|eot|ttf|otf)$/,
loader: "file-loader",
options: {
name: "[name].[hash].[ext]",
outputPath: "./assets/fonts"
}
},
{
test: /\.(mov|mp4)$/,
loader: "file-loader",
options: {
name: "[name].[hash].[ext]",
publicPath: "./assets/images",
outputPath: "./assets/videos"
}
}
]
}
};
Absolute path to video file is assets/images/hero_vid_bg.mp4