const path = require('path')
    // const BabiliPlugin = require("babili-webpack-plugin");
const webpack = require('webpack')
function resolve(dir) {
    return path.join(__dirname, dir)
}
module.exports = {
    entry: './components/index.js',
    output: {
        path: path.resolve(__dirname, './'),
        filename: '../index.js',
        library: 'VueOpenLayerMap',
        libraryTarget: 'umd'
    },
    module: {
        rules: [{
                test: /\.vue$/,
                loader: 'vue-loader'
            },
            {
                test: /\.js$/,
                loader: 'babel-loader',
                // include: [resolve('node_modules/_openlayers_echart@1.1.2@openlayers_echart')],
                exclude: /node_modules/,
                options: {
                    presets: ['es2015']
                }
            },
            // {
            //     test: /\.js$/,
            //     // exclude: /node_modules/,
            //     // include: [resolve('node_modules/_openlayers_echart@1.1.2@openlayers_echart')],
            //     use: [{
            //       loader: 'babel-loader',
            //       options: {
            //          presets: ['es2015']
            //       }
            //     }]
            //   },
            {
                test: /\.css$/,
                loader: 'style-loader!css-loader'
            },
            {
                test: /\.scss$/,
                use: ['style-loader', 'css-loader', 'sass-loader']
            },
            {
                test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
                loader: 'url-loader'
            },
            {
                test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/,
                loader: 'url-loader'
            }
        ]
    },
    // plugins: [
    //     new BabiliPlugin()
    // ],
}