text: const CopyWebpackPlugin = require("copy-webpack-plugin");
  const path = require("path");
  
  // Generate pages object
  const pagesObj = {};
  
  const chromeName = ["popup"];
  
  chromeName.forEach(name => {
    pagesObj[name] = {
      entry: `src/${name}/index.ts`,
      template: "public/index.html",
      filename: `${name}.html`
    };
  });
  
  const plugins =
    process.env.NODE_ENV === "production"
      ? [
          {
            from: path.resolve("src/manifest.production.json"),
            to: `${path.resolve("dist")}/manifest.json`
          }
        ]
      : [
          {
            from: path.resolve("src/manifest.development.json"),
            to: `${path.resolve("dist")}/manifest.json`
          }
        ];
  
  module.exports = {
    pages: pagesObj,
    configureWebpack: {
      entry: {
        content: "./src/content/index.ts",
        background: "./src/background/index.ts"
      },
      output: {
        filename: "js/[name].js"
      },
      plugins: [CopyWebpackPlugin(plugins)]
    },
    css: {
      extract: {
        filename: "css/[name].css"
        // chunkFilename: 'css/[name].css'
      }
    }
  };
  