如何使用 webpcak 4 加载 mp4 视频格式,我尝试这样:
{
test: /\.mp4$/,
use: 'file-loader',
loader: 'file-loader?name=videos/[name].[ext]',
},
并像这样导入
import pressButtonAnimated from './images/pressButtonAnimated.mp4'
但这对我不起作用,并且出现错误You may need an appropriate loader to handle this file type.
但这对我有用,但我不想在每个文件中添加
import pressButtonAnimated from '-!file-loader!./images/pressButtonAnimated.mp4'