webpack下require('art-template')打包时util报错 
错误:
`ERROR in ./~/readable-stream/lib/_stream_readable.js
Module not found: Error: Can't resolve 'util' in '/Users/gittaam/study/mall/node_modules/readable-stream/lib'
 @ ./~/readable-stream/lib/_stream_readable.js 72:16-31
 @ ./~/readable-stream/readable-browser.js
 @ ./~/stream-http/lib/request.js
 @ ./~/stream-http/index.js
 @ ./~/clean-css/lib/reader/load-remote-resource.js
 @ ./~/clean-css/lib/options/fetch.js
 @ ./~/clean-css/lib/clean.js
 @ ./~/clean-css/index.js
 @ ./~/html-minifier/src/htmlminifier.js
 @ ./~/art-template/lib/compile/adapter/html-minifier.js
 @ ./~/art-template/lib/compile/defaults.js
 @ ./~/art-template/lib/defaults.js
 @ ./~/art-template/lib/index.js
 @ ./~/art-template/index.js
 @ ./src/util/tools.js
 @ ./src/page/index/index.js
 @ multi ./src/page/index/index.js`


通用模块:
`
const template = require('art-template'); 
module.exports = {
    tpl: template
}
`

webpack配置:

`const webpack = require('webpack');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const HtmlWebpakPlugin = require('html-webpack-plugin');

let getHtml = (name) => {
    return {
        chunks: ['common', name],
        template: './src/view/' + name + '.html',
        filename: 'view/' + name + '.html',
        inject: true,
        hash: true
    }
}
let config = {
    entry: {
        'index': ['./src/page/index/index.js'],
        'login': ['./src/page/login/index.js'],
        'common': ['./src/page/common/index.js']
    },
    output: {
        path: __dirname + '/dist',
        publicPath: '/dist',
        filename: 'js/[name].js'
    },
    module: {
        rules: [{
                test: /\.css$/,
                use: ExtractTextPlugin.extract({
                    fallback: 'style-loader',
                    use: ['css-loader', 'autoprefixer-loader']
                })
            },
            {
                test: /\.less$/,
                use: ExtractTextPlugin.extract({
                    fallback: 'style-loader',
                    use: ['css-loader', 'autoprefixer-loader', 'less-loader']
                })
            },
            {
                test: /\.(gif)|(png)|(jpg)$/,
                use: ["url-loader?limit=8192&name=images/[hash:8].[name].[ext]"]
            },
            {
                test: /\.js$/,
                exclude: /(node_modules|bower_components)/,
                use: {
                    loader: 'babel-loader',
                    options: {
                        presets: ['es2015']
                    }
                }
            }, {
                test: /\.art$/,
                use: {
                    loader: 'art-template-loader'
                }
            }
        ]
    },
    resolve: {
        alias: {
            util: __dirname + '/src/util',
            page: __dirname + '/src/page'
        }
    },
    node: {
        fs: "empty"
    },
    plugins: [
        new ExtractTextPlugin('css/[name].css'), //分离css
        new webpack.optimize.CommonsChunkPlugin({ //打包公共依赖
            name: "common",
            filename: "js/common.js"
        }),
        //生成模板
        new HtmlWebpakPlugin(getHtml('index')),
        new HtmlWebpakPlugin(getHtml('login'))
    ]
}

module.exports = config;`

