【问题标题】:webpack angularjs es6 image pathwebpack angularjs es6 图片路径
【发布时间】:2016-03-18 11:10:54
【问题描述】:

我在视图上创建了一个带有 src 的标签 img;但图像不显示。 路径是什么? 谢谢大家 萨姆

我的 test.html

<div class="col-md-10">
    <img src='img/logo.png'></img>
    <h1> TEST
    </h1>

</div>4

我的结构是:

x:\src\pages\test\test.html

x:\src\pages\test\img\logo.png

webpack.config.js

 }, {
    // ASSET LOADER
    // Reference: https://github.com/webpack/file-loader
    // Copy png, jpg, jpeg, gif, svg, woff, woff2, ttf, eot files to output
    // Rename the file using the asset hash
    // Pass along the updated reference to your code
    // 
  test: /\.(png|jpg|jpeg|gif|svg|woff|woff2|ttf|eot)$/,
  loader: 'file'
}, {

【问题讨论】:

    标签: angularjs html image webpack webpack-dev-server


    【解决方案1】:

    我认为是你的 html 加载器。

    尝试将其从 raw-loader 更改为 html-loader :

    { 
        test: /\.html$/,
        loader: 'html'
    }
    

    https://github.com/webpack/html-loader

    【讨论】:

      猜你喜欢
      • 2019-10-27
      • 1970-01-01
      • 2016-01-19
      • 2018-08-20
      • 1970-01-01
      • 2012-06-11
      • 1970-01-01
      • 2016-12-09
      相关资源
      最近更新 更多