<commit_before>const path = require("path");
const merge = require("webpack-merge");
const webpack = require("webpack");

const common = require("./webpack.common.js");

const serverName = process.env.JS_SERVER || "agir.local";
const port = process.env.JS_SERVER
  ? +process.env.JS_SERVER.split(":")[1] || 3000
  : 3000;

common.module.rules
  .find(r => r.use && r.use.loader && r.use.loader.startsWith("babel-loader"))
  .use.options.plugins.push(["styled-components", { displayName: true }]);

module.exports = merge(common, {
  mode: "development",
  output: {
    publicPath: `http://${serverName}:${port}/static/components/`,
    devtoolModuleFilenameTemplate: "webpack://[absolute-resource-path]",
    filename: "[name]-[hash].js"
  },
  watchOptions: {
    poll: 1000
  },
  devServer: {
    publicPath: `http://${serverName}:${port}/static/components/`,
    public: `${serverName}:${port}`,
    contentBase: path.join(__dirname, "/assets/components/"),
    compress: true,
    hot: true,
    hotOnly: true,
    host: serverName === "localhost" ? "localhost" : "0.0.0.0",
    port: port,
    headers: {<commit_msg>Fix: npm run watch<commit_after>const path = require("path");
const merge = require("webpack-merge");
const webpack = require("webpack");

const common = require("./webpack.common.js");

const serverName = process.env.JS_SERVER || "agir.local";
const port = process.env.JS_SERVER
  ? +process.env.JS_SERVER.split(":")[1] || 3000
  : 3000;

const babelModule = common.module.rules.find(
  r => r.use && r.use.loader && r.use.loader.startsWith("babel-loader")
);

if (!babelModule.use.options) {
  babelModule.use.options = {};
}
if (!babelModule.use.options.plugins) {
  babelModule.use.options.plugins = [];
}

babelModule.use.options.plugins.push([
  "styled-components",
  { displayName: true }
]);

module.exports = merge(common, {
  mode: "development",
  output: {
    publicPath: `http://${serverName}:${port}/static/components/`,
    devtoolModuleFilenameTemplate: "webpack://[absolute-resource-path]",
    filename: "[name]-[hash].js"
  },
  watchOptions: {
    poll: 1000
  },
  devServer: {
    publicPath: `http://${serverName}:${port}/static/components/`,
    public: `${serverName}:${port}`,
    contentBase: path.join(__dirname, "/assets/components/"),
    compress: true,
    hot: true,
    hotOnly: true,
    host: serverName === "localhost" ? "localhost" : "0.0.0.0",
    port: port,
    headers: {
{'fraction_non_alphanumeric': 0.19319114027891715, 'fraction_numerical': 0.01394585726004922, 'mean_word_length': 4.08125, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2043671', 'n_tokens_mistral': 836, 'n_tokens_neox': 803, 'n_words': 144}