import path from 'path'

const library = 'postcss-js-loader'
const srcPath = path.resolve(__dirname, 'src')
const libPath = path.resolve(__dirname, 'lib')

export default {
  target: 'node',

  devtool: 'source-map',

  context: srcPath,

  entry: 'index.js',

  resolve: {
    root: srcPath,
  },

  output: {
    library,
    libraryTarget: 'commonjs2',
    filename: `${library}.js`,
    path: libPath,
  },

  module: {
    loaders: [
      {
        test: /\.js$/,
        include: srcPath,
        loader: 'babel',
      },
    ],
  },

  externals: {
    'loader-utils': 'loaderUtils',
    'postcss': 'postcss',
    'postcss-js': 'postcssJs',
    'webpack/lib/node/NodeTemplatePlugin': 'NodeTemplatePlugin',
    'webpack/lib/node/NodeTargetPlugin': 'NodeTargetPlugin',
    'webpack/lib/LibraryTemplatePlugin': 'LibraryTemplatePlugin',
    'webpack/lib/SingleEntryPlugin': 'SingleEntryPlugin',
    'webpack/lib/optimize/LimitChunkCountPlugin': 'LimitChunkCountPlugin',
  },
}

@@ -575,21 +575,12 @@
 s': 
-'loaderUtils'
+true
 ,%0A  
@@ -592,25 +592,20 @@
 stcss': 
-'postcss'
+true
 ,%0A    'p
@@ -620,19 +620,12 @@
 s': 
-'postcssJs'
+true
 ,%0A  
@@ -669,28 +669,12 @@
 n': 
-'NodeTemplatePlugin'
+true
 ,%0A  
@@ -716,26 +716,12 @@
 n': 
-'NodeTargetPlugin'
+true
 ,%0A  
@@ -763,31 +763,12 @@
 n': 
-'LibraryTemplatePlugin'
+true
 ,%0A  
@@ -806,27 +806,12 @@
 n': 
-'SingleEntryPlugin'
+true
 ,%0A  
@@ -862,31 +862,12 @@
 n': 
-'LimitChunkCountPlugin'
+true
 ,%0A  

Fix `externals` option of webpack config