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
Webpack 图层控件不可见网页包4_Webpack_Ngx Leaflet - Fatal编程技术网

Webpack 图层控件不可见网页包4

Webpack 图层控件不可见网页包4,webpack,ngx-leaflet,Webpack,Ngx Leaflet,我将ngx传单与webpack 4一起使用,但在显示图层控制图像时遇到问题。默认标记图标显示良好,因为我使用文件加载器从“传单/dist/images/layers.png”等导入图标名。该项目不使用CLI,而是使用独立的webpack 4。如果我使用相同的代码并在angular CLI项目中使用它,则在angular CLI标记解决方案部分中遵循资产配置后,图标会显示良好。我错过了什么?在不使用CLI的情况下显示此图标需要什么?我在开发者工具中没有发现错误,网络流量中似乎需要layers.pn

我将ngx传单与webpack 4一起使用,但在显示图层控制图像时遇到问题。默认标记图标显示良好,因为我使用文件加载器从“传单/dist/images/layers.png”等导入图标名。该项目不使用CLI,而是使用独立的webpack 4。如果我使用相同的代码并在angular CLI项目中使用它,则在angular CLI标记解决方案部分中遵循资产配置后,图标会显示良好。我错过了什么?在不使用CLI的情况下显示此图标需要什么?我在开发者工具中没有发现错误,网络流量中似乎需要layers.png

以下是网页包配置:

"use strict";

var path = require('path');
var webpack = require('webpack');

var ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');
var HappyPack = require('happypack');

module.exports = {
    mode: 'development',
    devtool: 'inline-source-map',
    entry:
            {
                polyfills: './src/polyfills.ts',                
                app: './src/main.ts'
            },
    output:
            {
                filename: '[name].js',
                chunkFilename: '[name]-chunk.js',
                publicPath: './dist/',
                path: path.resolve(__dirname, 'dist')
            },
    module: {
        rules: [              
              {
                  test: /\.html$/,
                  use: 'raw-loader'
              },
              {
                  test: /\.tsx?$/,
                  loaders: [
                            {
                                loader: 'cache-loader'
                            },
                            {
                                loader: 'happypack/loader'
                            },
                            {
                                loader: 'angular-router-loader'
                            }
                            ]
              },
              {
                  test: /\.(png|jpg|svg)$/,
                  use:
                  [
                      {
                          loader: 'file-loader',
                          options: 
                              {
                                  name: '[name].[ext]',
                                  outputPath: 'assets/'
                              }
                      }
                  ]
              }              
        ]
    },    
    plugins: [
                new webpack.ContextReplacementPlugin(/\@angular(\\|\/)core(\\|\/)esm5/, path.join(__dirname, './src')),
                new ForkTsCheckerWebpackPlugin({}),
                new HappyPack({
                    threads: 2,
                    loaders:
                        [
                            {
                                loader: 'ts-loader',
                                options: { transpileOnly: true, happyPackMode: true }
                            }
                        ]
                })        
    ]    
};

显示网页包config@MatheusSilva我已经用网页配置更新了这个问题。你有回购协议、提琴或其他我可以查看的东西中的工作示例吗?