Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/37.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

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
Css 网页包4,捆绑图标_Css_Webpack_Glyphicons - Fatal编程技术网

Css 网页包4,捆绑图标

Css 网页包4,捆绑图标,css,webpack,glyphicons,Css,Webpack,Glyphicons,我在理解如何使用webpack捆绑图标时遇到问题 这是我的网页文件 module.exports = { context: path.join(__dirname, "app"), devtool: 'source-map', entry: { main: ["./main.coffee"], vendor: ["./vendor.coffee"] }, resolve: { extensions: [".c

我在理解如何使用webpack捆绑图标时遇到问题

这是我的
网页
文件

module.exports = {
    context: path.join(__dirname, "app"),
    devtool: 'source-map',
    entry: {
        main: ["./main.coffee"],
        vendor: ["./vendor.coffee"]
    },
    resolve: {
        extensions: [".coffee", ".js", ".json", ".css", ".less", ".html"]
    },
    output: {
        path: path.join(__dirname, 'wwwroot'),
        filename: '[name].js',
        chunkFilename: '[id].chunk.js',
    },
    module: {
        rules: [
            {
                test: /\.coffee$/,
                use: ['coffee-loader'],
                exclude: /node_modules/
            },
            {
                test: /\.less$/i,
                use: css.extract({
                    fallback: "style-loader",
                    use: ['css-loader', 'less-loader']
                }),
                exclude: /node_modules/
            },
            { 
                test: /\.(png|woff|woff2|eot|ttf|svg)$/, 
                loader: 'url-loader?limit=100000' 
            }
        ]
    },
    plugins: [
        css,
        new cleanWebpackPlugin(["./wwwroot"])
    ],
    optimization: {
        splitChunks: {
            minSize: 2,
            name: true
        }
    }
}
这是我从webpack获得的输出

Child extract-text-webpack-plugin ../node_modules/extract-text-webpack-plugin/dist ../node_modules/css-loader/index.js!../node_modules/less-loader/dist/cjs.js!app.less:
    [0] ../Content/fonts/glyphicons-halflings-regular.eot 26.5 KiB {0} [built]
    [1] ../Content/images/nice_snow.png 23.9 KiB {0} [built]
    [2] ../Content/fonts/glyphicons-halflings-regular.svg 82.2 KiB {0} [built]
    [3] ../Content/fonts/glyphicons-halflings-regular.ttf 53.7 KiB {0} [built]
    [4] ../Content/fonts/glyphicons-halflings-regular.woff 30.4 KiB {0} [built]
    [7] ../node_modules/css-loader!../node_modules/less-loader/dist/cjs.js!./app.less 139 KiB {0} [built]
        + 2 hidden modules
下面是我如何导入glyphicons(它解析路径很好,您可以通过网页包输出消息来判断)

最后,这里是我得到的输出文件夹结构

 - wwwroot
    1. app.css
    2. app.css.map
    3. main.js
    4. main.js.map
    5. vendor.js
    6. vendor.js.map
现在,一切正常。所有的java脚本都捆绑在一起,css也是如此。只有字形图标不显示

 - wwwroot
    1. app.css
    2. app.css.map
    3. main.js
    4. main.js.map
    5. vendor.js
    6. vendor.js.map