var path = require('path');
var webpack = require('webpack');

var config = {
  mode: process.env.NODE_ENV || "development",
  entry: {
    background: './src/background.js',
    contentscript: './src/contentscript.js',
    links: './src/links.js',
    options: './src/options.js',
  },
  output: {
    path: path.resolve('./js/'),
    filename: '[name].js',
  },
  module: {
    rules: [
      {
        test: /\.css$/,
        use: [
          'style-loader',
          'css-loader',
        ],
      },
      {
        test: /\.jsx?$/,
        exclude: /node_modules/,
        use: [
          {
            loader: 'babel-loader',
          }
        ],
      },
    ]
  },
  resolve: {
    extensions: ['.js', '.jsx']
  },
  externals: {
    'chrome': 'chrome',
  },
  optimization: {
    minimize: false,
    runtimeChunk: false,
    splitChunks: {
      cacheGroups: {
        commons: {
          name: 'preamble',
          test: /[\\/]node_modules[\\/]/,
          chunks: 'all',
          enforce: true,
        },
      },
    },
  },
  devtool: 'cheap-module-source-map',
};

module.exports = config;

@@ -118,16 +118,51 @@
 pment%22,%0A
+  context: path.resolve('./src/'),%0A
   entry:
@@ -183,20 +183,16 @@
 und: './
-src/
 backgrou
@@ -221,20 +221,16 @@
 ipt: './
-src/
 contents
@@ -254,20 +254,16 @@
 nks: './
-src/
 links.js
@@ -281,20 +281,16 @@
 ons: './
-src/
 options.

use webpack's context option