1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75
| var path = require('path'); var webpack = require('webpack'); var config = require('../config') var ExtractTextPlugin = require('extract-text-webpack-plugin'); var AssetsPlugin = require('assets-webpack-plugin'); module.exports = { entry: { libs: [ 'vue/dist/vue.esm.js', 'vue-router', 'vue-infinite-scroll', 'vue-cookie', 'vuex', 'jquery', 'iscroll', 'weui.js', 'video.js', 'babel-polyfill', 'resetcss', 'font-awesome/css/font-awesome.min.css', 'video.js/dist/video-js.min.css', 'element-ui', 'element-ui/lib/theme-default/index.css', ] }, output: { path: path.resolve(__dirname, '../public'), filename: '[name].[chunkhash:7].js', library: '[name]_library' }, plugins: [ new webpack.DllPlugin({ path: path.resolve(__dirname, '../public/[name]-mainfest.json'), name: '[name]_library', context: __dirname }), new ExtractTextPlugin('[name].[contenthash:7].css'), new webpack.optimize.UglifyJsPlugin({ compress: { warnings: false }, }), new AssetsPlugin({ filename: 'bundle-config.json', path: './public' }), ], module: { rules: [ { test: /\.css$/, use: ExtractTextPlugin.extract({ fallback: "style-loader", use: "css-loader" }) }, { test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, loader: 'url-loader', query: { limit: 10000, name: 'img/[name].[hash:7].[ext]' } }, { test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, loader: 'url-loader', query: { limit: 10000, name: 'fonts/[name].[hash:7].[ext]' } } ] }, }
|