繁体   English   中英

Webpack 配置以包含内联图像

[英]Webpack config to include inline images

所以我想在 html 中包含内联图像(带有 < img > 标签),但浏览器不会加载我列出的图像。 我在 webpack 配置文件中写了一条规则,但它没有改变任何东西:

{
        exclude: /node_modules/,
        test: /\.(jpe?g|png|gif|svg)$/i,
        loader: require.resolve('file-loader'),
        options: {
          name: '/images/[name].[ext]',
          publicPath: 'images/',
          outputPath: 'images/',
        },
      },

我的图像位于 src 文件夹中的“图像”文件夹中。 那么你能告诉我我的 webpack 配置有什么问题吗?或者还有其他问题吗?

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM