
[new] add test config [new] add breadcrumb test [change] update package.json [new] util.js copied from element [unresolved] see test/unit/index.js @todo
42 lines
1.2 KiB
JavaScript
42 lines
1.2 KiB
JavaScript
/**
|
|
* 本地预览
|
|
*/
|
|
|
|
var path = require('path');
|
|
var webpack = require('webpack');
|
|
// var ExtractTextPlugin = require('extract-text-webpack-plugin');
|
|
var HtmlWebpackPlugin = require('html-webpack-plugin');
|
|
var merge = require('webpack-merge')
|
|
var webpackBaseConfig = require('./webpack.base.config.js');
|
|
var FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin')
|
|
|
|
|
|
module.exports = merge(webpackBaseConfig, {
|
|
// 入口
|
|
entry: {
|
|
main: './examples/main',
|
|
vendors: ['vue', 'vue-router']
|
|
},
|
|
// 输出
|
|
output: {
|
|
path: path.join(__dirname, '../examples/dist'),
|
|
publicPath: '',
|
|
filename: '[name].js',
|
|
chunkFilename: '[name].chunk.js'
|
|
},
|
|
resolve: {
|
|
alias: {
|
|
iview: '../../src/index',
|
|
vue: 'vue/dist/vue.js'
|
|
}
|
|
},
|
|
plugins: [
|
|
new webpack.optimize.CommonsChunkPlugin({ name: 'vendors', filename: 'vendor.bundle.js' }),
|
|
new HtmlWebpackPlugin({
|
|
inject: true,
|
|
filename: path.join(__dirname, '../examples/dist/index.html'),
|
|
template: path.join(__dirname, '../examples/index.html')
|
|
}),
|
|
new FriendlyErrorsPlugin()
|
|
]
|
|
});
|