const webpack = require('webpack'); const path = require('path'); const VueLoaderPlugin = require('vue-loader/lib/plugin'); const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin; module.exports = { entry: { main : "./main.js", // vendors: ['jquery', 'rem', 'vue'], }, output: { }, resolve: { extensions: ['.js', '.vue', '.scss'], alias: { "@": path.resolve(__dirname), "vue": 'vue/dist/vue.esm.js', "rem": path.resolve(__dirname, './depend/rem/rem.js'), "form": path.resolve(__dirname, './depend/form/form.js'), "md5": path.resolve(__dirname, './depend/md5/md5.js'), "cookie": path.resolve(__dirname, './depend/cookie/cookie.js'), "store": path.resolve(__dirname, './depend/store/store.js'), "lib": path.resolve(__dirname, './depend/lib/lib.js'), "extSdk": path.resolve(__dirname, './depend/extSdk/extSdk.js'), "config": path.resolve(__dirname, './depend/config/config.js'), "pay": path.resolve(__dirname, './depend/pay/pay.js'), } }, module: { rules: [{ test: /\.js$/, exclude: /(node_modules|bower_components)/, use: { loader : 'babel-loader', options : { presets : ['es2015'] } } },{ test: /\.vue$/, loader: 'vue-loader' },{ test: /\.scss$/, use: [ 'vue-style-loader', 'css-loader', 'sass-loader' ] },{ test: /\.(png|jpg|gif)$/i, use: [ { loader: 'url-loader', options: { limit: 8192, outputPath: 'img/' } } ] },{ test: /\.(html|tpl)$/, use: 'html-loader' },{ test: /\.json$/, use: 'json-loader' }] }, // babel: { // presets: ['es2015'] // }, plugins: [ // new BundleAnalyzerPlugin(), new VueLoaderPlugin(), new webpack.optimize.ModuleConcatenationPlugin(), new webpack.HotModuleReplacementPlugin(), new webpack.LoaderOptionsPlugin({ minimize: true }), new webpack.ProvidePlugin({ $: "jquery", jQuery: "jquery", "window.jQuery": "jquery" }) ] };