text: const path = require('path')
  const webpack = require('webpack')
  
  const HtmlWebpackPlugin = require('html-webpack-plugin')
  const OpenBrowserPlugin = require('open-browser-webpack-plugin')
  
  module.exports = {
    entry: path.join(__dirname, '../src/main.js'),
  
    devtool: 'inline-source-map',
  
    output: {
      path: path.join(__dirname, '../dist'),
      filename: 'bundle.[hash].js',
    },
  
    module: {
      rules: [
        {
          test: /\.js$/,
          use: ['babel-loader?cacheDirectory=true'],
          include: path.join(__dirname, 'src')
        },
        {
          test: /\.(woff|woff2|eot|ttf|otf)$/,
          loader: 'file-loader'
        },
        {
          test: /\.css$/,
          use: [ 'style-loader', 'css-loader' ]
        },
        {
          test: /\.vue$/,
          loader: 'vue-loader',
          exclude: /(node_modules)/
        },
        {
          test: /\.styl$/,
          loader: 'style-loader!css-loader!stylus-loader',
          exclude: /node_modules/
        }
      ]
    },
  
    resolve: {
      extensions: ['.js', '.vue', '.json'],
      alias: {
        'assets': path.resolve(__dirname, '../src/assets'),
        'components': path.resolve(__dirname, '../src/components'),
        'common': path.resolve(__dirname, '../src/common')
      }
    },
  
    plugins: [
      new HtmlWebpackPlugin({
        title: 'title',
        template: path.join(__dirname, '../index.html'),
        inject: true,
        minify: {
          removeComments: true,
          collapseWhitespace: true,
          removeAttributeQuotes: true
        }
      }),
      new webpack.HotModuleReplacementPlugin(),
      new OpenBrowserPlugin({ url: 'http://localhost:8888' }),
      new webpack.DefinePlugin({
        'process.env.NODE_ENV': JSON.stringify('development')
      })
    ],
  
    devServer: {
      contentBase: path.join(__dirname, '../dist'),
      port: 8888,
      historyApiFallback: true,
      host: '0.0.0.0',
      hot: true
    }
  }
  