Webpack无法读取未定义的属性“Blob”

时间:2017-10-28 15:52:43

标签: javascript webpack webpack-dev-server webpack-2

条目文件将在字面上构建得很好,但是错误发生在客户端,这使得整个软件包文件无法解决此问题Uncaught TypeError: Cannot read property 'Blob' of undefined

我已经附加了webpack.config.js,我也试过了

const path = require('path')
const webpack = require('webpack')
const HtmlPlugin = require('html-webpack-plugin')
const ExtractTextPlugin = require('extract-text-webpack-plugin')

const config = {
    entry: './src/main-entry.js',
    output: {
        path: path.resolve(__dirname, 'views/dist'),
        filename: 'bundle.js'
    },
    module: {
        rules: [
            { test: /\.(png|woff|woff2|eot|ttf|svg|gif)$/, loader: 'url-loader?limit=100000' },
            {
                test: /\.css$/,
                use: ExtractTextPlugin.extract({
                    use: 'css-loader', fallback: 'style-loader'
                })
            },
            {
                test: /\.js$/,
                loader: 'babel-loader',
                exclude: /node_modules/
            }
        ]
    },
    plugins: [
        new ExtractTextPlugin('bundle.css'),
        new webpack.optimize.UglifyJsPlugin({
            include: /\.min\.js$/,
            minimize: true
        })
    ]
}

module.exports = config

我正在使用webpack最新版本。但我不知道为什么会这样?你能救我吗?

0 个答案:

没有答案