const helpers = require('./helpers');
const HtmlWebpackPlugin = require('html-webpack-plugin');

module.exports = {
  mode: 'development',
  entry: './src/index.js',
  output: {
    filename: 'index.js',
    path: helpers.root('dist')
  },
  resolve: { extensions: ['.js'] },
  module: {
    rules: [
      {
        test: /\.svg$/,
        loader: 'svg-inline-loader'
      }
    ]
  },
  plugins: [
    new HtmlWebpackPlugin({
      template: 'demo-templates/index.html' // to use demo-templates/index.html for dev mode and open it in the browser;
    })
  ],
  devServer: {
    static: helpers.root('dist'),
    port: 9030,
    open: true
  }
};
