// var webpack = require('webpack');
var path = require('path');

module.exports = {
    entry: {
        main : "./main.js",
        vendors: ['jquery', 'vue'],
    },
    output: {
    },
    resolve: {
        extensions: ['', '.js', '.vue'],
        alias: {
            "vue": 'vue/dist/vue.js',
            "rem": path.resolve(__dirname, './depend/rem/rem.js'),
            "md5": path.resolve(__dirname, './depend/md5/md5.js'),
            "lib": path.resolve(__dirname, './depend/lib/lib.js'),
            "BDY": path.resolve(__dirname, './depend/BDY/BDY.js'),
            "lrz": path.resolve(__dirname, './depend/localResizeIMG/lrz.all.bundle.js'),
            "nprogress": path.resolve(__dirname, './depend/nprogress/nprogress.js'),
            "extSdk": path.resolve(__dirname, './depend/extSdk/extSdk.js'),
            "API": path.resolve(__dirname, './depend/API/API.js')
        }
    },
    module: {
        loaders: [
            { test: /\.vue$/, loader: 'vue' },
            { test: /\.js$/, loader: 'babel', exclude: /node_modules/ },
            { test: /\.css$/, loader: 'style!css!autoprefixer'},
            { test: /\.scss$/, loader: 'style!css!sass'},
            { test: /\.(gif|jpg|png|woff|svg|eot|ttf)\??.*$/, loader: 'url-loader?limit=8192'},
            { test: /\.(html|tpl)$/, loader: 'html-loader' }
        ]
    },
    babel: {
        presets: ['es2015']
    },
    plugins: [
        // generateHtmlPlugin("index"),
        // new webpack.optimize.CommonsChunkPlugin(/* chunkName= */'vendor', /* filename= */'vendor.js', Infinity),
        // new webpack.ProvidePlugin({
        //     $: "jquery",
        //     jQuery: "jquery",
        //     "window.jQuery": "jquery"
        // }),
        // new webpack.optimize.UglifyJsPlugin({ minimize: true }),
        // new ExtractTextPlugin("global.css"),
        // new webpack.DefinePlugin({
        //     'process.env': {
        //         NODE_ENV: JSON.stringify("production")
        //     }
        // }),
    ],
    extraPath: "../../../../"

};
