{"size": 1596, "ext": "js", "max_stars_repo_path": "webpack.dev.js", "max_stars_repo_name": "VladimirPittner/button-lpdck", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "webpack.dev.js", "max_issues_repo_name": "VladimirPittner/button-lpdck", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "webpack.dev.js", "max_forks_repo_name": "VladimirPittner/button-lpdck", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 24.1818181818, "max_line_length": 66, "alphanum_fraction": 0.4943609023}
const path = require('path');
const fs = require('fs');
const webpack = require('webpack');
const { merge } = require('webpack-merge');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const common = require('./webpack.common.js');

const rootDir = path.resolve(__dirname);
const appSrc = fs.realpathSync(path.join(rootDir, 'src'));

module.exports = merge(common, {
  mode: 'development',
  devtool: 'inline-source-map',
  module: {
    rules: [
      {
        test: /\.(css|scss)$/,
        include: [appSrc],
        use: [
          {
            loader: 'style-loader',
          },
          {
            loader: 'css-loader',
            options: {
              importLoaders: 2,
              modules: {
                mode: 'local',
                localIdentName: '[local]',
                localIdentContext: path.resolve(__dirname, 'src'),
              },
              sourceMap: true,
            },
          },
          {
            loader: 'postcss-loader',
          },
          {
            loader: 'sass-loader',
            options: {
              sourceMap: true,
            },
          },
        ],
      },
    ],
  },
  devServer: {
    contentBase: path.join(__dirname, 'public/'),
    port: 3000,
    publicPath: '/dist/',
    hot: true,
    writeToDisk: (filePath) => {
      return /index\.html$/.test(filePath);
    },
  },
  plugins: [
    new webpack.HotModuleReplacementPlugin(),
    new HtmlWebpackPlugin({
      title: 'Title',
      template: 'src/index.html',
      filename: path.join(rootDir, 'public', 'index.html'),
    }),
  ],
});
