Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/webpack/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何使用网页包加载html中的图像?_Html_Webpack_Webpack Dev Server - Fatal编程技术网

如何使用网页包加载html中的图像?

如何使用网页包加载html中的图像?,html,webpack,webpack-dev-server,Html,Webpack,Webpack Dev Server,我有以下html和一些SVG和图像: <body class="noselect"> <div class="noselect viewer" id="plotter"> <a class="arrow-controls next-page flex" id="next"> <?xml version="1.0" encoding="utf-8"?> <!DOCTYPE

我有以下
html
和一些SVG和图像:

<body class="noselect">
    <div class="noselect viewer" id="plotter">
        <a class="arrow-controls next-page flex" id="next">
            <?xml version="1.0" encoding="utf-8"?>
            <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
            <svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="20" height="20" viewBox="0 0 20 20">
                <path fill="#fff" d="M5 20c-0.128 0-0.256-0.049-0.354-0.146-0.195-0.195-0.195-0.512 0-0.707l8.646-8.646-8.646-8.646c-0.195-0.195-0.195-0.512 0-0.707s0.512-0.195 0.707 0l9 9c0.195 0.195 0.195 0.512 0 0.707l-9 9c-0.098 0.098-0.226 0.146-0.354 0.146z"></path>
            </svg>
        </a>
        <a class="arrow-controls previous-page flex" id="prev">
            <?xml version="1.0" encoding="utf-8"?>
            <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
            <svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="20" height="20" viewBox="0 0 20 20">
                <path fill="#fff" d="M14 20c0.128 0 0.256-0.049 0.354-0.146 0.195-0.195 0.195-0.512 0-0.707l-8.646-8.646 8.646-8.646c0.195-0.195 0.195-0.512 0-0.707s-0.512-0.195-0.707 0l-9 9c-0.195 0.195-0.195 0.512 0 0.707l9 9c0.098 0.098 0.226 0.146 0.354 0.146z"></path>
            </svg>
        </a>
        <div id="book">
            <div class="page green left">
                <img src = "../images/page-1.jpg" width="100%" height="100%" /> 
            </div>
            <div class="page blue right flipped"> 
                <img src = "../images/page-2.jpg" width="100%" height="100%" />
             </div>
            <div class="page green left "> 
                <img src = "../images/page-3.jpg" width="100%" height="100%" />
            </div>
            <div class="page blue right flipped"> 
                <img src = "../images/page-4.jpg" width="100%" height="100%" />
            </div>
            <div class="page green left"> 
                <img src = "../images/page-5.jpg" width="100%" height="100%" />
            </div>
            <div class="page blue right flipped"> 
                <img src = "../images/page-6.jpg" width="100%" height="100%" />
            </div>
            <div class="page green left">
                <img src = "../images/page-7.jpg" width="100%" height="100%" />
            </div>
            <div class="page blue right flipped">
                <img src = "../images/page-8.jpg" width="100%" height="100%" />
            </div>
            <div class="page green left ">
                <img src = "../images/page-9.jpg" width="100%" height="100%" />
            </div>
            <div class="page blue right flipped">
                <img src = "../images/page-10.jpg" width="100%" height="100%" />
            </div>
            <div class="page green left">
                <img src = "../images/page-11.jpg" width="100%" height="100%" />
            </div>
            <div class="page blue right flipped">
                <img src = "../images/page-12.jpg" width="100%" height="100%" />
            </div>
        </div>
    </div>
    <script src="../bundle.js"></script>
</body>

</html>
然后在条目文件:[
${{uuu dirname}/lib/script.js
]上,我有:

import '../css/style.css';

import '../html/index.html';

import 'babel-polyfill';
css
导入可以很好地处理其中的背景图像,但是
html
中的图像不提供服务。我想我现在正在和网页兜圈子

如何为html页面的常规图像提供服务?欧欧欧

import '../css/style.css';

import '../html/index.html';

import 'babel-polyfill';